Skip to content
FUMODocs

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 the Responses API instead

Get an API key →

Use a FUMO Dashboard key for an account registered and funded online.

Base URLhttps://capi.fumolab.ai/api/fusion/v1
EndpointPOST /chat/completions
AuthorizationBearer <API_KEY>
Content typeapplication/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

ProductAuthorized model IDProduct focus
Fusion Max 2.0fusion-max-2.0High-performance coding, agents and document analysis, built for cost efficiency.
Fusion Max 1.0fusion-max-1.0Complex reasoning, research, and demanding agentic workloads
Fusion Code 1.0fusion-code-1.0Coding, 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

FieldBehavior
modelRequired model ID authorized for your key
messagesRequired non-empty conversation with text and image input
streamReturns server-sent events when true
stream_options.include_usageWhen true, adds a final usage-only chunk to a streaming response
temperatureNumber from 0 to 2; applied to collaborative generation and final synthesis
top_pNumber from 0 to 1; applied to collaborative generation and final synthesis
max_tokens, max_completion_tokensPositive client-visible output limit; if both are sent, their values must match
stopOne non-empty string or an array of one to four non-empty strings
nOnly 1 is supported
toolsFunction tools using JSON Schema parameters
tool_choicenone, auto, required, or a named function
parallel_tool_callsControls whether the final response may contain more than one tool call
response_formattext, json_object, or json_schema
modalitiesIf present, must be ["text"]
functions, function_callLegacy 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:

  1. 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;
  2. a terminal choice with finish_reason;
  3. when stream_options.include_usage is true, a usage-only chunk with an empty choices array;
  4. 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;
  • n values greater than 1;
  • frequency_penalty, presence_penalty, logit_bias, or deterministic seed semantics;
  • logprobs or top_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": "..."
}
StatusMeaning
400Malformed JSON, invalid parameters, or invalid schema
401Missing, malformed, or invalid API key
403The key is not entitled to use the requested model or service
404Unknown route or model alias
429Model concurrency or another request limit was reached
501The requested endpoint is not implemented
502Fusion or an upstream generation dependency failed
503Authentication 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.