Shakespeare AI uses Nostr NIP-98 authentication instead of traditional API keys. All requests must be signed using your Nostr private key.
Returns a list of available models and their specifications.
| Model ID | Description | Context Window | Pricing |
|---|---|---|---|
glm-4.5 |
High-quality model (GLM-4.5) | 128,000 tokens | $0.0000015/prompt token $0.0000075/completion token |
claude-sonnet-4.5 |
Claude Sonnet 4.5 (via OpenRouter) | 200,000 tokens | $0.000004/prompt token $0.000016/completion token |
Creates a completion for the chat message. Compatible with OpenAI's chat completions API.
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Model to use (glm-4.5, claude-sonnet-4.5) |
messages |
array | Yes | Array of message objects |
temperature |
number | No | Sampling temperature (0-2) |
max_tokens |
integer | No | Maximum tokens to generate |
stream |
boolean | No | Whether to stream responses |
Retrieves the user's current credit balance.
Initiates a payment to add credits to the user's account. Supports Stripe and Lightning Network payments.
Checks the status of a payment. Payments are automatically completed via webhooks when successful.
Retrieves a paginated list of payments for the user.
| Parameter | Type | Description |
|---|---|---|
limit |
integer | Maximum number of payments to return (default: 20, max: 100) |
starting_after |
string | Payment ID for pagination |
status |
string | Filter by status: pending, completed, failed, expired |
method |
string | Filter by method: stripe, lightning |
Shakespeare AI uses standard HTTP status codes and returns errors in OpenAI-compatible format.
| HTTP Status | Error Code | Description |
|---|---|---|
| 401 | unauthorized | Invalid or missing NIP-98 authentication |
| 400 | invalid_request_error | Invalid request format or parameters |
| 429 | insufficient_quota | Insufficient credits for premium models |
| 500 | api_error | Internal server or upstream provider error |
minimum_amount_not_met - Payment amount below minimum
threshold
unsupported_method - Payment method not supportedmissing_required_parameter - Required parameter missing
payment_not_found - Payment ID not foundpayment_expired - Payment has expiredNeed help? Shakespeare AI is open source. Check the GitLab repository for more information or to report issues.