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"
}