REST API
The Chucky service provides a REST endpoint for one-shot prompts. This is useful when you don’t need a persistent WebSocket session.For multi-turn conversations or streaming with tools, use the WebSocket API instead.
Endpoint
Request
Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | Must be application/json |
Accept | No | Response format: text/event-stream for SSE, application/json for JSON (default) |
Body
Options
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | JWT authentication token |
model | string | No | Claude model (default: claude-sonnet-4-5-20250929) |
systemPrompt | string | No | System prompt for Claude |
tools | array | No | Tool definitions |
allowedTools | string[] | No | Whitelist of allowed tools |
disallowedTools | string[] | No | Blacklist of blocked tools |
maxTurns | number | No | Maximum conversation turns |
maxBudgetUsd | number | No | Max cost for this request |
maxThinkingTokens | number | No | Max tokens for extended thinking |
outputFormat | object | No | Structured output schema |
mcpServers | object | No | MCP server configurations |
Response Formats
JSON Response (Default)
WhenAccept: application/json or no Accept header:
SSE Response (Streaming)
WhenAccept: text/event-stream:
Error Responses
Authentication Errors
401 Unauthorized
Budget Exceeded
429 Too Many Requests
Concurrency Limit
429 Too Many Requests
Developer Budget Exceeded
402 Payment Required
Examples
cURL - JSON Response
cURL - SSE Streaming
JavaScript - Fetch with JSON
JavaScript - SSE Streaming
Python - Requests
Comparison: REST vs WebSocket
| Feature | REST /prompt | WebSocket /ws |
|---|---|---|
| Multi-turn conversations | No | Yes |
| Session persistence | No | Yes |
| Streaming | SSE only | Full duplex |
| Client-side tools | Limited | Full support |
| Best for | Simple one-shot queries | Interactive apps |