Skip to main content

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
PlaceholderValues today
modelceleris-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

FieldTypeRequiredNotes
modelstringyesMust equal the model in the URL path, e.g. celeris-1.
messagesarrayyesOpenAI message objects (rolesystem | user | assistant, content string).
max_tokensintegerrecommendedCompletion-token limit. Size it for the expected response; see parameter guidance.
temperaturenumberno0 recommended for structured tasks.
top_pnumbernoStandard nucleus sampling.
seedintegernoReproducible sampling when combined with temperature: 0.
stopstring | arraynoStop sequences.
nintegernoNumber of choices.
presence_penalty, frequency_penaltynumbernoStandard penalties.
streambooleannoSet true for SSE chunks.
stream_options.include_usagebooleannoWith 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

HeaderMeaning
AuthorizationRequired on every call: Bearer dg_... (details).
Content-Typeapplication/json on POST.
X-Client-Trace-IdOptional caller-supplied trace ID. Echoed on responses so you can correlate failures with application logs and support cases.

Response headers

HeaderMeaning
Server-TimingCombined server-side processing duration in milliseconds. See Measuring latency.
X-Client-Trace-IdYour 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-HeadersLets browser code read Server-Timing and the trace-id headers cross-origin.
Retry-AfterOn 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.

Statuserror.codeReference
400Varies by validation error400 Bad Request
401invalid_api_key401 Unauthorized
402insufficient_quota402 Payment Required
404not_found404 Not Found
413payload_too_large413 Payload Too Large
429rate_limit_exceeded / service_busy429 Too Many Requests
502upstream_error502 Bad Gateway
503service_unavailable503 Service Unavailable