Chat Completions
DEVUP AI provides an OpenAI-compatible Chat Completions endpoint for supported chat models. Note that feature and parameter support may vary by model.
https://api.devupai.com/v1/chat/completionsChoose your SDK
The DEVUP AI SDK provides native access to the platform. OpenAI SDKs can be used with the OpenAI-compatible endpoint by configuring the DEVUP AI base URL, API key, and model identifier.
Basic chat completion
By setting the baseURL and passing your DEVUP AI token, you can send requests directly to our optimized inference infrastructure.
Multi-turn conversations
Models do not store memory. To maintain conversational state, you must pass the entire conversation history in the messages array on each request.
Supported parameters
We support the majority of standard OpenAI chat completion parameters.
Required
ID of the model to use. See the model library for all available options. The model must be served on this endpoint: an image, speech, video, embedding or reranking model returns HTTP 400 wrong_endpoint, naming the endpoint that serves it, and the request is not billed.
A list of messages comprising the conversation so far. When the last message in the conversation is from the assistant, the model answers with a new assistant message. On some models this needs a short user message: "Continue." is then added, with a notice in _devup.warnings. A model that cannot answer such a conversation returns HTTP 400 conversation_must_end_with_user before any charge.
Generation controls
The maximum number of tokens that can be generated in the chat completion. The largest accepted value, for max_tokens and max_completion_tokens, is the model's own max_output_tokens in GET /v1/models; a larger value returns HTTP 400 invalid_max_tokens. When neither is sent, the reply is limited to the model's default output length, which is at most its max_output_tokens. Reasoning models spend part of this budget thinking before they answer. With images, audio or video in the request, set it high enough — 2000 or more is a safe start — or the reply can come back empty with finish_reason "length".
What sampling temperature to use. Higher values make output more random, lower values make it more focused.
An alternative to sampling with temperature, called nucleus sampling.
Up to 4 sequences where the API will stop generating further tokens.
Positive values penalize new tokens based on whether they appear in the text so far.
Positive values penalize new tokens based on their existing frequency in the text so far.
Streaming
If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events.
Structured output & tools
An object specifying the format that the model must output. Compatible with JSON mode and structured outputs. On a model that returns JSON inside a Markdown code fence, the fence around the whole reply is removed, with the notice json_fence_removed. On a model that does not apply json_schema itself but enforces tool calls, a json_schema request without streaming is answered through a forced tool call and returned as message.content (notice structured_output_via_tool); with strict: true, a reply that does not match the schema returns structured_output_mismatch.
A list of tools the model may call, and controls for which tool is called.
Controls which tool is called by the model.
Set to false to ask the model for at most one tool call per reply. Send it together with tools: on some models it is left out without tools, with the notice parameter_not_supported. tool_calls.parallel in GET /v1/models is true for models that can return several tool calls in one reply. See parallel tool calls.
How much the model reasons before answering, for example low, medium or high. When known, reasoning.values in GET /v1/models lists the reasoning levels you can send to the model with reasoning.parameter, from least to most reasoning. none, when listed, turns reasoning off. How much each level changes the reasoning depends on the model. Some models list a single value, which turns reasoning on. Reasoning tokens count as output tokens.
{"enabled": true} asks for reasoning. On models that take reasoning_effort, it is applied as reasoning_effort "medium", with a notice in _devup.warnings; when reasoning_effort is also sent, reasoning_effort wins. {"enabled": false} does not turn reasoning off on those models: the model reasons at its default level, with a notice.
Max output tokens
Model limits
Each model has its own limit on how many output tokens it can generate in a single request: its max_output_tokens in GET /v1/models. A larger max_tokens or max_completion_tokens returns HTTP 400 invalid_max_tokens, with a message that names the parameter you sent and the model's limit. When you send neither, the reply is limited to the model's default output length, which is at most its max_output_tokens, or less when the prompt leaves less room in the model's context window.
Continuing responses
If a model stops generating because it reached the limit, the finish_reason will be length. You can send the truncated response back as an assistant message and the model will continue right where it left off.
Note: The model may repeat or overlap slightly when continuing. It is not always a completely seamless continuation.