Chat Completions API
Fusion Max and Fusion Code provide an OpenAI-compatible Chat Completions endpoint. This reference describes the supported fields, response formats, and validation rules.
Use a FUMO Dashboard key for an account registered and funded online.
| Base URL | https://capi.fumolab.ai/api/fusion/v1 |
| Endpoint | POST /chat/completions |
| Authorization | Bearer <API_KEY> |
| Content type | application/json |
Request
Public requests require an authorized model ID and a non-empty messages array.
{
"model": "fusion-max-1.0",
"messages": [
{ "role": "system", "content": "Return a concise technical answer." },
{ "role": "user", "content": "Compare the two implementation options." }
],
"stream": true,
"temperature": 0.2
}
Model IDs and core routing
| Product | Authorized model ID | Product focus |
|---|---|---|
| Fusion Max 2.0 | fusion-max-2.0 | High-performance coding, agents and document analysis, built for cost efficiency. |
| Fusion Max 1.0 | fusion-max-1.0 | Complex reasoning, research, and demanding agentic workloads |
| Fusion Code 1.0 | fusion-code-1.0 | Coding, debugging, terminal work, and software-agent workflows |
Requests require a model ID authorized for your key. The service configuration determines the internal model topology for Fusion Max and Fusion Code. See Getting started for the full model list.
Messages
Use the standard system, developer, user, assistant, and tool roles.
The array must contain at least one message. Unsupported roles are rejected with 400 invalid_parameter before any upstream call.
content may be a string or an array containing text parts with type text, input_text, or output_text. User messages may also contain standard image_url parts:
{
"role": "user",
"content": [
{ "type": "text", "text": "Describe the architecture in this diagram." },
{
"type": "image_url",
"image_url": { "url": "https://example.com/architecture.png" }
}
]
}
Audio and file content parts are not supported.
Chat Completions is stateless: send the complete conversation history on every turn.
Supported request fields
| Field | Behavior |
|---|---|
model | Required model ID authorized for your key |
messages | Required non-empty conversation with text and image input |
stream | Returns server-sent events when true |
stream_options.include_usage | When true, adds a final usage-only chunk to a streaming response |
temperature | Number from 0 to 2; applied to collaborative generation and final synthesis |
top_p | Number from 0 to 1; applied to collaborative generation and final synthesis |
max_tokens, max_completion_tokens | Positive client-visible output limit; if both are sent, their values must match |
stop | One non-empty string or an array of one to four non-empty strings |
n | Only 1 is supported |
tools | Function tools using JSON Schema parameters |
tool_choice | none, auto, required, or a named function |
parallel_tool_calls | Controls whether the final response may contain more than one tool call |
response_format | text, json_object, or json_schema |
modalities | If present, must be ["text"] |
functions, function_call | Legacy aliases normalized to tools and tool_choice |
reasoning_effort: Only Fusion Max 2.0 supports low, medium, high, and max, defaulting to medium. Max 1.0 and Code 1.0 do not support adjustable effort.
Unknown top-level fields are accepted for compatibility, recorded as structured warnings, and removed before execution.
Tool calling
Only the final Fusion response can issue a client-visible tool call. Intermediate collaborative work cannot execute a client tool or return an authoritative call.
{
"model": "fusion-code-1.0",
"messages": [
{
"role": "user",
"content": "Check the deployment status for service api."
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_deployment_status",
"description": "Return the current deployment status for a service.",
"parameters": {
"type": "object",
"properties": {
"service": { "type": "string" }
},
"required": ["service"],
"additionalProperties": false
},
"strict": true
}
}
],
"tool_choice": "auto"
}
Each tool must use type: "function" and have a non-empty function.name. When strict is true, function.parameters is required and the returned arguments are validated against that schema.
Structured output
Use response_format to require a JSON object:
{
"type": "json_object"
}
Or provide a JSON Schema:
{
"type": "json_schema",
"json_schema": {
"name": "review",
"schema": {
"type": "object",
"properties": {
"approved": { "type": "boolean" },
"reason": { "type": "string" }
},
"required": ["approved", "reason"],
"additionalProperties": false
}
}
}
Fusion validates the complete final text against the requested contract before returning it. It does not extract JSON from surrounding prose.
Streaming
With stream: true, Fusion returns text/event-stream using chat.completion.chunk frames.
A successful stream contains:
- an assistant role frame, optional
delta.reasoning_content, and either content deltas or a validated tool-call delta; a pure tool-call response may not contain a content delta; - a terminal choice with
finish_reason; - when
stream_options.include_usageistrue, a usage-only chunk with an emptychoicesarray; data: [DONE].
Possible finish_reason values are stop, length, and tool_calls.
Structured output, explicit output limits, stop sequences, and required tool calls may require buffering before validated content is released. Tool calls are emitted after their complete arguments have been validated.
Response
A buffered success follows the standard Chat Completions shape:
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1785200000,
"model": "fusion-max-1.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 120,
"completion_tokens": 48,
"total_tokens": 168
}
}
Clients should rely on the standard token fields shown above. Additional usage metadata may change as the service evolves.
Unsupported fields and endpoints
The current request contract does not support:
- audio or file inputs;
nvalues greater than 1;frequency_penalty,presence_penalty,logit_bias, or deterministicseedsemantics;logprobsortop_logprobs;store,metadata,prediction,prompt_cache_options,prompt_cache_retention, safety-identifier, user-tracking, web-search, or moderation extensions.
Syntactically valid unsupported parameters are recorded as structured warnings and removed before execution. Invalid values, conflicting controls, and unsupported content parts still cause validation errors. prompt_cache_key is accepted as a transport-only affinity hint; it does not configure model-side prompt caching.
Other unsupported endpoints include:
- Anthropic Messages;
- legacy text Completions;
- embeddings, images, or audio endpoints.
Errors
An invalid request, such as an empty messages array, returns 400 with code: "invalid_parameter". The exact message and envelope may vary by gateway:
{
"error": {
"message": "...",
"type": "invalid_request_error",
"code": "invalid_parameter",
"param": "messages"
},
"request_id": "..."
}
| Status | Meaning |
|---|---|
400 | Malformed JSON, invalid parameters, or invalid schema |
401 | Missing, malformed, or invalid API key |
403 | The key is not entitled to use the requested model or service |
404 | Unknown route or model alias |
429 | Model concurrency or another request limit was reached |
501 | The requested endpoint is not implemented |
502 | Fusion or an upstream generation dependency failed |
503 | Authentication or another gateway dependency is unavailable |
Use the returned request_id when contacting FUMO Lab support.
Verify access with a direct request · Use the Responses API
Model capabilities
All three models support text/image input, text/tool-call output, Chat Completions and Responses. Agents read files; native file upload is not supported.
Only Fusion Max 2.0 supports low, medium, high, and max, defaulting to medium. Max 1.0 and Code 1.0 do not support adjustable effort.
