Skip to content

Claude Opus 5.5 ​

This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.

Endpoint ​

POST /claude/v1/messages

Full URL: https://ai.modelfold.online/claude/v1/messages

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

Streaming Support ​

When stream: true is set in the request, the API returns responses as server-sent events (SSE). Claude tool calling responses stream tool_use blocks and input_json_delta fragments.

Streaming Response Format:

  • Content-Type: text/event-stream
  • Event names include message_start, content_block_start, content_block_delta, message_delta, and message_stop
  • Tool calls are emitted as tool_use content blocks
  • Final stop reason is often tool_use for function-calling requests

Features ​

  • Standard chat with messages.
  • Function calling with tools and input_schema.
  • Optional stream response with Claude events.
  • Optional thinking flag (thinkingFlag).

Request Notes ​

  • Put the current model name in the model field.
  • Use messages for conversation history.
  • Use tools to declare callable functions.
  • Set stream to true for SSE output.

Authentication ​

Authentication: send Authorization: Bearer YOUR_API_KEY. Clients that send x-api-key (such as the Anthropic SDK) must set it to Bearer YOUR_API_KEY. anthropic-version is optional.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesModel id for this page, e.g. claude-opus-5-5. Available ids are listed by GET https://ai.modelfold.online/v1/anthropic/v1/models%60. Allowed values:claude-opus-5-5。 示例:claude-opus-5-5`。
messagesarray&lt;object&gt;YesConversation messages in chronological order.
  messages[].rolestringYesMessage role. Allowed values:user / assistant。 示例:user。
  messages[].content`stringarray<object>`Yes
toolsarray&lt;object&gt;NoOptional callable tools. Each tool includes a name, description, and input_schema.
  tools[].namestringYesFunction name. 示例:get_current_weather。
  tools[].descriptionstringYesHuman-readable function description. 示例:Get the current weather in a given location。
  tools[].input_schemaobjectYesJSON Schema for function parameters.
    tools[].input_schema.typestringNoSchema type. 示例:object。
    tools[].input_schema.propertiesobjectNoFunction parameter definitions.
    tools[].input_schema.requiredarray&lt;string&gt;NoRequired parameter names.
thinkingFlagbooleanNoWhether to enable thinking. 示例:true。
streambooleanNoIf set to true, the response is returned as an SSE stream. Default:true。 示例:false。
max_tokensnumberNoOptional Claude output token limit. Leave empty to use the default of 4096. Default:4096。 示例:4096。

Request Example ​

bash
curl -X POST "https://ai.modelfold.online/claude/v1/messages" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "claude-opus-5-5",
  "messages": [
    {
      "role": "user",
      "content": "What is the weather like in Boston today?"
    }
  ],
  "tools": [
    {
      "name": "get_current_weather",
      "description": "Get the current weather in a given location",
      "input_schema": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and state, e.g. Boston, MA"
          }
        },
        "required": [
          "location"
        ]
      }
    }
  ],
  "thinkingFlag": true,
  "stream": false,
  "max_tokens": 4096
}'
json
{
  "model": "claude-opus-5-5",
  "messages": [
    {
      "role": "user",
      "content": "What is the weather like in Boston today?"
    }
  ],
  "tools": [
    {
      "name": "get_current_weather",
      "description": "Get the current weather in a given location",
      "input_schema": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and state, e.g. Boston, MA"
          }
        },
        "required": [
          "location"
        ]
      }
    }
  ],
  "thinkingFlag": true,
  "stream": false,
  "max_tokens": 4096
}

Response ​

200 — Request successful. ​

参数类型必填说明
rolestring否Returned message role 示例:assistant。
usageobject否Usage information returned in the response
  usage.input_tokensinteger否Input token count 示例:600。
  usage.output_tokensinteger否Output token count 示例:57。
  usage.cache_creation_input_tokensinteger否Cache creation input token count 示例:0。
  usage.cache_read_input_tokensinteger否Cache read input token count 示例:0。
  usage.service_tierstring否Service tier 示例:standard。
stop_reasonstring否Reason why generation stopped 示例:tool_use。
modelstring否Actual model version returned in the response 示例:claude-opus-4-5-20251101。
idstring否Unique message identifier 示例:msg_01VSoxV4a8YWB3DBh9TdM63W。
credits_consumednumber否Credits consumed by the request 示例:0.25。
typestring否Top-level response object type 示例:message。
contentarray&lt;object&gt;否Response content blocks
  content[].inputobject否Tool input arguments
  content[].callerobject否Tool caller metadata
    content[].caller.typestring否示例:direct。
  content[].namestring否Tool name 示例:get_current_weather。
  content[].idstring否Tool call identifier 示例:toolu_018gdqs2FHxrRjQHLZv1qvbF。
  content[].typestring否Content block type 示例:tool_use。
json
{
  "role": "assistant",
  "usage": {
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "output_tokens": 57,
    "service_tier": "standard",
    "cache_creation_input_tokens": 0,
    "input_tokens": 600,
    "cache_read_input_tokens": 0,
    "inference_geo": "not_available"
  },
  "stop_reason": "tool_use",
  "model": "claude-opus-5-5",
  "id": "msg_01VSoxV4a8YWB3DBh9TdM63W",
  "credits_consumed": 0.28,
  "type": "message",
  "content": [
    {
      "input": {
        "location": "Beijing, China"
      },
      "caller": {
        "type": "direct"
      },
      "name": "get_current_weather",
      "id": "toolu_018gdqs2FHxrRjQHLZv1qvbF",
      "type": "tool_use"
    }
  ]
}

400 — Bad Request - Invalid request parameters ​

参数类型必填说明
errorobject否—
  error.messagestring否示例:Invalid request parameters。
  error.typestring否示例:invalid_request_error。
json
{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error"
  }
}

401 — Unauthorized - Invalid or missing API key ​

参数类型必填说明
errorobject否—
  error.messagestring否示例:Invalid or missing API key。
  error.typestring否示例:authentication_error。
json
{
  "error": {
    "message": "Invalid or missing API key",
    "type": "authentication_error"
  }
}

ModelFold — one API for all the best AI models.