Request and response format
Every field the /v1/think endpoint accepts and returns, including streaming, function calling, and errors.
Early Access. Deepgram LLMs are available only to current Deepgram contract customers enrolled in the Early Access program (talk to sales for access). Usage is free during Early Access, requests run on the global endpoint only, SDKs do not support the endpoint yet, and the API can change before general availability. Do not run production traffic on it.
This page is the reference for /v1/think during Early Access. Both models use the same format.
The request and response follow the OpenAI Chat Completions structure, so most Chat Completions client code carries over. The differences are called out in each section below.
Endpoint and authentication
Authenticate with your Deepgram API key using the Token scheme:
To authenticate from a browser or other untrusted client, use a short-lived token from token-based authentication with the Bearer scheme: Authorization: Bearer <token>.
Deepgram never forwards your credentials to the model service.
Request body
Send JSON with Content-Type: application/json. The endpoint accepts the eight fields below and rejects any other top-level field.
Unsupported fields
These Chat Completions fields are rejected as unknown fields: max_tokens, max_completion_tokens, top_p, stop, n, seed, tool_choice, response_format, frequency_penalty, presence_penalty, logprobs, and user. Remove them before sending a request.
Messages
messages is an array of message objects. The endpoint identifies each message by its shape. Use the standard roles: system, user, assistant, and tool.
Think-Fast does not accept the developer role. A developer message returns 400 with the body {"message":"Invalid request","type":"Bad Request","code":400} and no dg-error header. Send those instructions as a system message instead. Some frameworks, including Pipecat, send developer messages by default. phoneLLM mini accepts the developer role.
content must be a plain string. The array-of-content-parts form is not supported.
System, user, and assistant messages
Assistant message with tool calls
Each tool call has this shape:
function.arguments is a JSON-encoded string.
Tool result message
Conversation history
The endpoint is stateless. Send the full conversation, including earlier tool calls and tool results, on every request.
Generation controls
temperaturesets sampling randomness. Lower values give more consistent replies.reasoning_effortsets how much the model reasons before answering. Think-Fast doesn’t reason by default: leave it unset or set it tonone, because other values add reasoning tokens and latency.
Streaming
Set stream to true and stream_options to {"include_usage": true}. The response has Content-Type: text/event-stream.
Each event’s data: line holds a chat.completion.chunk object. The stream then ends in this order:
- A chunk whose choice has
finish_reasonset, such as"stop". - A final chunk with an empty
choicesarray and ausageobject. data: [DONE]
If the model service’s stream breaks off, the response ends without [DONE]. Treat a missing [DONE] as a failed request.
For a full streaming loop, see Build a cascaded agent.
Function calling
Pass function tools in tools. function is the only supported tool type.
When the model calls a tool, the response message contains tool_calls. To continue:
- Run the function in your application.
- Append the assistant message with its
tool_callstomessages. - Append a
toolmessage with the result and the matchingtool_call_id. - Send the request again with the same
tools.
The assistant message can contain content as well as tool_calls, such as “Sure, checking on that order.” Speak it, and keep it in the assistant message you append.
The endpoint forwards tool-call history intact, so the model can keep calling tools across turns.
Response format
A successful response returns the model’s status code and body unchanged.
When stream is false, the response is 200 with Content-Type: application/json and a chat.completion object:
Usage
Errors
Errors that Deepgram returns use the standard Deepgram error body, and the same message appears in the dg-error response header:
Errors from the model service are relayed unchanged, with their own status code and error body.
A stream that ends without data: [DONE] also means the request failed. The model service’s stream broke off after the response started, so no error status is sent. Treat the response as incomplete and retry.