Felo API PlatformFelo API Platform
v0.3.0
OpenAPI 3.1.0

Create a Claude message

服务器:https://openapi.felo.ai
客户端库

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.

请求体·ClaudeMessagesRequest
必填
application/json
  • max_tokens
    类型: integer
    最小值:  
    1
    必填

    Integer numbers.

  • messages
    类型: array object[] · ClaudeMessage[] 1…
    必填
    • content
      必填
      • 类型: string
    • role
      类型: string 枚举
      必填
      值
      • user
      • assistant
    • propertyName
      类型: anything
  • model
    类型: string
    必填
  • metadata
    类型: object
    • propertyName
      类型: anything
  • service_tier
    类型: string
  • stop_sequences
    类型: array string[]
  • stream
    类型: boolean
  • system
    • 类型: string
  • temperature
    类型: number
    最小值:  
    0
    最大值:  
    1
  • thinking
    类型: object
    • propertyName
      类型: anything
  • tool_choice
    • 类型: string
  • tools
    类型: array object[]
    • propertyName
      类型: anything
  • propertyName
    类型: anything
  • top_k
    类型: integer
    最小值:  
    0

    Integer numbers.

  • top_p
    类型: number
    最小值:  
    0
    最大值:  
    1
  • propertyName
    类型: anything
响应
  • 200
    类型: object · ClaudeMessageResponse

    Claude message or streaming response

    • content
      类型: array object[] · ClaudeContentBlock[]
      必填
      • type
        类型: string 枚举
        必填
        值
        • text
        • image
        • document
        • tool_use
        • tool_result
        • thinking
      • content
        类型: string | array
      • id
        类型: string
      • input
        类型: object
        • propertyName
          类型: anything
      • name
        类型: string
      • source
        类型: object
        • propertyName
          类型: anything
      • text
        类型: string
      • propertyName
        类型: anything
    • id
      类型: string
      必填
    • model
      类型: string
      必填
    • role
      常量:  
      assistant
      必填
    • stop_reason
      类型: string | null
      必填
    • type
      常量:  
      message
      必填
    • stop_sequence
      类型: string | null
    • usage
      类型: object · Usage

      Provider usage object. Fields vary by endpoint and provider.

      • propertyName
        类型: anything
    • propertyName
      类型: anything
  • 400
    类型: object · ClaudeErrorResponse

    Claude invalid_request_error or Router request validation error

    Claude Errors API-compatible error envelope for Messages requests.

    • error
      类型: object
      必填
      • message
        类型: string
        必填
      • type
        类型: string
        必填
      • propertyName
        类型: anything
    • type
      常量:  
      error
      必填
    • request_id
      类型: string
    • propertyName
      类型: anything
    application/json
  • 401
    类型: object · ClaudeErrorResponse

    Invalid or missing Felo API key

    Claude Errors API-compatible error envelope for Messages requests.

    • error
      类型: object
      必填
      • message
        类型: string
        必填
      • type
        类型: string
        必填
      • propertyName
        类型: anything
    • type
      常量:  
      error
      必填
    • request_id
      类型: string
    • propertyName
      类型: anything
    application/json
  • 402
    类型: object · ClaudeErrorResponse

    Insufficient balance

    Claude Errors API-compatible error envelope for Messages requests.

    • error
      类型: object
      必填
      • message
        类型: string
        必填
      • type
        类型: string
        必填
      • propertyName
        类型: anything
    • type
      常量:  
      error
      必填
    • request_id
      类型: string
    • propertyName
      类型: anything
    application/json
  • 403
    类型: object · ClaudeErrorResponse

    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.

    • error
      类型: object
      必填
      • message
        类型: string
        必填
      • type
        类型: string
        必填
      • propertyName
        类型: anything
    • type
      常量:  
      error
      必填
    • request_id
      类型: string
    • propertyName
      类型: anything
    application/json
  • 429
    类型: object · ClaudeErrorResponse

    Spending or request limit reached

    Claude Errors API-compatible error envelope for Messages requests.

    • error
      类型: object
      必填
      • message
        类型: string
        必填
      • type
        类型: string
        必填
      • propertyName
        类型: anything
    • type
      常量:  
      error
      必填
    • request_id
      类型: string
    • propertyName
      类型: anything
    application/json
  • 502
    类型: object · ClaudeErrorResponse

    Upstream provider request failed

    Claude Errors API-compatible error envelope for Messages requests.

    • error
      类型: object
      必填
      • message
        类型: string
        必填
      • type
        类型: string
        必填
      • propertyName
        类型: anything
    • type
      常量:  
      error
      必填
    • request_id
      类型: string
    • propertyName
      类型: anything
    application/json
  • 503
    类型: object · ClaudeErrorResponse

    Provider or billing service unavailable

    Claude Errors API-compatible error envelope for Messages requests.

    • error
      类型: object
      必填
      • message
        类型: string
        必填
      • type
        类型: string
        必填
      • propertyName
        类型: anything
    • type
      常量:  
      error
      必填
    • request_id
      类型: string
    • propertyName
      类型: anything
    application/json
Request Example for post/api/v1/messages
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"
}
Create a Claude message