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.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 ck_...

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 | tool). content is a string, or an array of content parts: {"type": "text", "text": ...} and {"type": "image_url", "image_url": {"url": "data:<media-type>;base64,..."}}. Attach as many image_url parts as you need, using inline data: URLs only; see Image input. Prompt tokens plus max_tokens must be at most 131,072.
max_tokensintegerrecommendedCompletion-token limit. Any positive integer, and prompt tokens plus max_tokens must be at most 131,072. Defaults to 2048 when omitted. A zero or negative value, or a value that would exceed the context window, is rejected. 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.
toolsarraynoFunction/tool definitions in the OpenAI tools schema. When the model calls one, the reply's message.tool_calls carries the function name and JSON arguments, and finish_reason is tool_calls. Send the result back as a tool message to continue.
tool_choicestring | objectnoauto (the default, where the model decides), none (never call), required (directs the model to call one of tools), or {"type": "function", "function": {"name": "..."}} to direct a specific function. required and named forcing apply to non-streaming requests; confirm the reply carries tool_calls. See Tool calling.
response_formatobjectnoConstrain non-streaming /chat/completions output to JSON: {"type": "json_object"}, or {"type": "json_schema", "json_schema": {"name": "...", "schema": {...}}} to validate against a schema. See JSON mode.
chat_template_kwargsobjectnoTemplate controls. {"enable_thinking": true} makes the model reason before answering (off by default); where the reasoning is separated it is returned on message.reasoning, apart from message.content. See Reasoning.
include_reasoningbooleannoChat-only (the Responses API has no equivalent). Defaults to true; set false and the reasoning field comes back null instead of carrying the working. It does not suppress a working that was not separated for that request. See Reasoning for the response shape and the post-tool-result exception.
presence_penalty, frequency_penaltynumbernoStandard penalties.
streambooleannoSet true for SSE chunks.
stream_options.include_usagebooleannoWith streaming, set true to receive the final exact-usage block.

The effective input limit is 131,072 - max_tokens. Requests over the token limit return 400; request bodies over the endpoint's 64 MiB 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).

When the request enables thinking (chat_template_kwargs: {"enable_thinking": true}), message may also carry a reasoning string alongside content; while streaming it arrives as delta.reasoning chunks ahead of delta.content. Reasoning tokens count as completion tokens in usage. See Reasoning for when it is present and how to detect it.

POST /v1/responses

Create a model response with the OpenAI Responses API, an alternative to /chat/completions that takes a single input instead of a messages array. It returns one JSON body or an SSE stream (details) and reports token usage. Each request is self-contained: send the full input on every call.

Request body

FieldTypeRequiredNotes
modelstringyesMust equal the model in the URL path, e.g. celeris-1.
inputstring | arrayyesA prompt string, or an array of OpenAI input messages (rolesystem | user | assistant). A message's content is a string, or an array of input parts: {"type": "input_text", "text": ...} and {"type": "input_image", "image_url": "data:<media-type>;base64,...", "detail": "auto"}. The chat text / image_url spellings are rejected here, and detail is required; attach as many input_image parts as you need. See Image input.
instructionsstringnoSystem-level guidance applied ahead of input.
max_output_tokensintegernoOutput-token limit; any positive integer, bounded by the 131,072-token context window, with the same rejection rules as max_tokens above, but not its 2048 default. When omitted, Responses uses the context window remaining after the rendered input; set it explicitly to bound latency and cost.
temperaturenumberno0 recommended for structured tasks.
top_pnumbernoStandard nucleus sampling.
chat_template_kwargsobjectno{"enable_thinking": true} makes the model reason before answering (off by default); where the reasoning is separated it is returned as an output item of type: "reasoning", ahead of the message item. See Reasoning.
streambooleannoSet true for Responses SSE events.

Response body

{
"id": "resp_9f2e41c0",
"object": "response",
"created_at": 1751673600,
"status": "completed",
"model": "celeris-1",
"output": [
{
"id": "msg_1a2b3c4d",
"type": "message",
"status": "completed",
"role": "assistant",
"content": [{"type": "output_text", "text": "Positive", "annotations": []}]
}
],
"usage": {"input_tokens": 27, "output_tokens": 2, "total_tokens": 29}
}

The generated text is at the type: "message" item's content[0].text (the OpenAI SDK also exposes it as response.output_text). When thinking is enabled and the reasoning is separated, an output item of type: "reasoning" precedes that message item; take the answer from the message item, never the reasoning. See Reasoning on the Responses API for that item's shape and how to detect it. When streaming, the event sequence ends with a response.completed event.

GET /v1/models

Lists the model served at this base URL, in the standard OpenAI list shape:

curl https://inference.celeris.ai/celeris-1/v1/models \
-H "Authorization: Bearer $CELERIS_API_KEY"

Retrieve a single model by id with GET /v1/models/celeris-1 to get that model's metadata in the standard OpenAI object shape:

curl https://inference.celeris.ai/celeris-1/v1/models/celeris-1 \
-H "Authorization: Bearer $CELERIS_API_KEY"

Request headers

HeaderMeaning
AuthorizationRequired on every call: Bearer ck_... (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-TimingService processing duration until the response headers are ready, in milliseconds. For streaming this precedes the first token. 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