API reference
Celeris implements the OpenAI chat-completions wire format. For usage examples and parameter guidance, see Making requests.
Base URL
https://inference.cloud.celeris.ai/<model>/v1
| Placeholder | Values today |
|---|---|
model | celeris-1 |
The model request-body field must match the <model> path segment.
Authentication
All endpoints require a bearer key (details):
Authorization: Bearer dg_...
POST /chat/completions
Create a chat completion. Responses can return as one JSON body or as an SSE stream (details).
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | Must equal the model in the URL path, e.g. celeris-1. |
messages | array | yes | OpenAI message objects (role ∈ system | user | assistant, content string). |
max_tokens | integer | recommended | Completion-token limit. Size it for the expected response; see parameter guidance. |
temperature | number | no | 0 recommended for structured tasks. |
top_p | number | no | Standard nucleus sampling. |
seed | integer | no | Reproducible sampling when combined with temperature: 0. |
stop | string | array | no | Stop sequences. |
n | integer | no | Number of choices. |
presence_penalty, frequency_penalty | number | no | Standard penalties. |
stream | boolean | no | Set true for SSE chunks. |
stream_options.include_usage | boolean | no | With streaming, set true to receive the final exact-usage block. |
Prompt plus completion must fit the model's 4,096-token context window.
Requests over the token limit return 400; request bodies over
the endpoint's byte limit return 413.
Response body
{
"id": "chatcmpl-9f2e41c0",
"object": "chat.completion",
"created": 1751673600,
"model": "celeris-1",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Positive"},
"finish_reason": "stop"
}
],
"usage": {"prompt_tokens": 27, "completion_tokens": 2, "total_tokens": 29}
}
finish_reason is stop (natural completion or stop sequence) or length
(hit max_tokens).
GET /models
Lists the model served at this base URL, in the standard OpenAI list shape:
curl https://inference.cloud.celeris.ai/celeris-1/v1/models \
-H "Authorization: Bearer $CELERIS_API_KEY"
Request headers
| Header | Meaning |
|---|---|
Authorization | Required on every call: Bearer dg_... (details). |
Content-Type | application/json on POST. |
X-Client-Trace-Id | Optional caller-supplied trace ID. Echoed on responses so you can correlate failures with application logs and support cases. |
Response headers
| Header | Meaning |
|---|---|
Server-Timing | Combined server-side processing duration in milliseconds. See Measuring latency. |
X-Client-Trace-Id | Your request's trace id, echoed back if you sent one. |
Access-Control-Allow-Origin: * | Browser calls are supported from any origin (details). |
Access-Control-Expose-Headers | Lets browser code read Server-Timing and the trace-id headers cross-origin. |
Retry-After | On 429: seconds to wait before retrying. |
Errors
See Errors for causes, response bodies, and handling guidance. API
errors use {"error": {message, type, code}}; use error.code when a status
has more than one possible cause.
| Status | error.code | Reference |
|---|---|---|
| 400 | Varies by validation error | 400 Bad Request |
| 401 | invalid_api_key | 401 Unauthorized |
| 402 | insufficient_quota | 402 Payment Required |
| 404 | not_found | 404 Not Found |
| 413 | payload_too_large | 413 Payload Too Large |
| 429 | rate_limit_exceeded / service_busy | 429 Too Many Requests |
| 502 | upstream_error | 502 Bad Gateway |
| 503 | service_unavailable | 503 Service Unavailable |