Create a Claude message
Claude Messages API-compatible endpoint. Set stream=true to receive Claude-style message stream events. Request, response, and validation-error fields follow the Claude Messages protocol; the Router may also return a sanitized gateway error envelope for infrastructure failures.
- 类型: integermax
_tokens 最小值:1必填Integer numbers.
- 类型: array object[] · ClaudeMessage[] 1…messages必填
- content必填
- 类型: string
- role类型: string 枚举必填值
- user
- assistant
- property类型: anything
Name
- 类型: stringmodel必填
- 类型: objectmetadata
- property类型: anything
Name
- 类型: stringservice
_tier - 类型: array string[]stop
_sequences - 类型: booleanstream
- system
- 类型: string
- 类型: numbertemperature最小值:0最大值:1
- 类型: objectthinking
- property类型: anything
Name
- tool
_choice - 类型: string
- 类型: array object[]tools
- property类型: anything
Name
- 类型: anythingproperty
Name
- 类型: integertop
_k 最小值:0Integer numbers.
- 类型: numbertop
_p 最小值:0最大值:1 - 类型: anythingproperty
Name
- 类型: object · ClaudeMessageResponse200
Claude message or streaming response
- 类型: array object[] · ClaudeContentBlock[]content必填
- type类型: string 枚举必填值
- text
- image
- document
- tool
_use - tool
_result - thinking
- content类型: string | array
- id类型: string
- input类型: object
- property类型: anything
Name
- name类型: string
- source类型: object
- property类型: anything
Name
- text类型: string
- property类型: anything
Name
- 类型: stringid必填
- 类型: stringmodel必填
- role常量:assistant必填
- 类型: string | nullstop
_reason 必填 - type常量:message必填
- 类型: string | nullstop
_sequence - 类型: object · Usageusage
Provider usage object. Fields vary by endpoint and provider.
- property类型: anything
Name
- 类型: anythingproperty
Name
- 类型: object · ClaudeErrorResponse400
Claude invalid_request_error or Router request validation error
Claude Errors API-compatible error envelope for Messages requests.
- 类型: objecterror必填
- message类型: string必填
- type类型: string必填
- property类型: anything
Name
- type常量:error必填
- 类型: stringrequest
_id - 类型: anythingproperty
Name
application/json - 类型: object · ClaudeErrorResponse401
Invalid or missing Felo API key
Claude Errors API-compatible error envelope for Messages requests.
- 类型: objecterror必填
- message类型: string必填
- type类型: string必填
- property类型: anything
Name
- type常量:error必填
- 类型: stringrequest
_id - 类型: anythingproperty
Name
application/json - 类型: object · ClaudeErrorResponse402
Insufficient balance
Claude Errors API-compatible error envelope for Messages requests.
- 类型: objecterror必填
- message类型: string必填
- type类型: string必填
- property类型: anything
Name
- type常量:error必填
- 类型: stringrequest
_id - 类型: anythingproperty
Name
application/json - 类型: object · ClaudeErrorResponse403
Account is not permitted to use the model. Disabled models are also rejected before upstream calls. Existing accepted requests and tasks continue.
Claude Errors API-compatible error envelope for Messages requests.
- 类型: objecterror必填
- message类型: string必填
- type类型: string必填
- property类型: anything
Name
- type常量:error必填
- 类型: stringrequest
_id - 类型: anythingproperty
Name
application/json - 类型: object · ClaudeErrorResponse429
Spending or request limit reached
Claude Errors API-compatible error envelope for Messages requests.
- 类型: objecterror必填
- message类型: string必填
- type类型: string必填
- property类型: anything
Name
- type常量:error必填
- 类型: stringrequest
_id - 类型: anythingproperty
Name
application/json - 类型: object · ClaudeErrorResponse502
Upstream provider request failed
Claude Errors API-compatible error envelope for Messages requests.
- 类型: objecterror必填
- message类型: string必填
- type类型: string必填
- property类型: anything
Name
- type常量:error必填
- 类型: stringrequest
_id - 类型: anythingproperty
Name
application/json - 类型: object · ClaudeErrorResponse503
Provider or billing service unavailable
Claude Errors API-compatible error envelope for Messages requests.
- 类型: objecterror必填
- message类型: string必填
- type类型: string必填
- property类型: anything
Name
- type常量:error必填
- 类型: stringrequest
_id - 类型: anythingproperty
Name
application/json
curl https://openapi.felo.ai/api/v1/messages \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"model": "claude-sonnet-4-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Write a one-sentence greeting."
}
],
"stream": false
}'
{
"id": "string",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "string",
"id": "string",
"name": "string",
"input": {
"additionalProperty": "anything"
},
"content": "string",
"source": {
"additionalProperty": "anything"
},
"additionalProperty": "anything"
}
],
"model": "string",
"stop_reason": null,
"stop_sequence": null,
"usage": {
"additionalProperty": "anything"
},
"additionalProperty": "anything"
}