Skip to main content

Chat Completions

POST /v1/chat/completions

OpenAI's Chat Completions format, for tools that do not speak Responses yet. TokHive converts the request to Responses and converts the result back into a chat.completion object, or a stream of chat.completion.chunk events. Supply, verification and billing are those of Responses. For new code, prefer Responses: it supports more of the model's features.

Example​

curl https://api.tokhive.ai/v1/chat/completions \
-H "Authorization: Bearer $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-sol",
"messages": [{"role": "user", "content": "Reply with exactly OK."}]
}'

model and a non-empty messages are required. Only OpenAI models are accepted; a Claude model returns 400 wrong_protocol. "stream": true returns chunks as server-sent events, and otherwise a single JSON object is returned.

Supported fields​

Chat fieldBehavior
system, developer, user, assistant messagesSupported. Text and inline user images are converted. system is sent as developer.
tools, tool_choiceFunction tools are supported; other tool types are refused.
tool_calls and tool messagesConverted to function calls and their outputs. Keep each call together with its result when continuing.
functions, function_call, function messagesThe legacy function format is converted too.
response_formatjson_object and json_schema are supported.
reasoning_effortSets the reasoning effort. The reasoning summary comes back in the extension field reasoning_content.
parallel_tool_calls, service_tierPassed through.
streamSupported.

Images must be inline base64 data URLs (PNG, JPEG, GIF or WebP). Remote image URLs are refused, because TokHive does not fetch them.

Ignored fields​

temperature, top_p, max_tokens, max_completion_tokens, stop, n, logprobs, user, presence_penalty, frequency_penalty, metadata and similar fields are silently dropped: the subscription upstream does not accept them. Don't rely on them to shape the output, and in particular don't rely on max_tokens to limit its length.

Conversations​

A Chat request carries no conversation identity, and TokHive keeps no history between calls. Send the full conversation every time.