Skip to main content

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

Body

Options

Response Formats

JSON Response (Default)

When Accept: application/json or no Accept header:

SSE Response (Streaming)

When Accept: text/event-stream:

Error Responses

Authentication Errors

Status: 401 Unauthorized

Budget Exceeded

Status: 429 Too Many Requests

Concurrency Limit

Status: 429 Too Many Requests

Developer Budget Exceeded

Status: 402 Payment Required

Examples

cURL - JSON Response

cURL - SSE Streaming

JavaScript - Fetch with JSON

JavaScript - SSE Streaming

Python - Requests


Usage API

Check current token usage against budget limits.

Endpoint

Request

Headers

Response

Response Fields

AI cost is tracked in microdollars (1 USD = 1,000,000 microdollars). Compute time is tracked in seconds.

Examples

cURL

JavaScript

Python


Comparison: REST vs WebSocket