Felo API PlatformFelo API Platform
v0.4.0
OpenAPI 3.1.0

สร้างข้อความ Claude

เซิร์ฟเวอร์:https://openapi.felo.ai
ไลบรารีไคลเอนต์

สร้างข้อความ Claude

​

endpoint ที่เข้ากันได้กับ Claude Messages API ตั้งค่า stream=true เพื่อรับอีเวนต์สตรีมข้อความแบบ Claude ฟิลด์คำขอ การตอบกลับ และข้อผิดพลาดจากการตรวจสอบจะเป็นไปตามโปรโตคอล Messages ของ Claude ส่วน Router อาจคืนซองข้อผิดพลาดของเกตเวย์ที่ผ่านการฟอกแล้วเมื่อโครงสร้างพื้นฐานขัดข้อง

เฮดเดอร์
  • X-Felo-Channel
    ประเภท: string

    รหัสช่องทางสาธารณะที่คั่นด้วยเครื่องหมายจุลภาคตามลำดับ หากไม่ส่งเฮดเดอร์นี้จะใช้ default โดยต้องใช้ default เดี่ยว ๆ เท่านั้น ในโหมดกระเป๋าเงิน default จะสแกนลำดับช่องทางสาธารณะที่มีผลของโมเดลจากท้ายไปต้น ข้ามช่องทางที่ยังไม่เผยแพร่หรือไม่พร้อมใช้งาน และเลือกผู้ให้บริการของช่องทางแรกที่พร้อมใช้งาน โดยจะรวม endpoint ที่พร้อมใช้งานของผู้ให้บริการรายนั้นที่มี upstream model ID และระดับบริการเดียวกัน ช่องทางที่ระบุอย่างชัดเจนจะถูกตรวจสอบตามลำดับที่ไคลเอนต์กำหนด และส่งเฉพาะกลุ่มผู้ให้บริการของช่องทางแรกเท่านั้น ไม่มีการสลับไปยังผู้ให้บริการรายอื่นโดยอัตโนมัติ เฮดเดอร์ผู้ให้บริการแบบเดิมไม่สามารถแทนที่การกำหนดเส้นทางตามช่องทางได้

บอดี้·ClaudeMessagesRequest
จำเป็น
application/json
  • max_tokens
    ประเภท: integer
    ต่ำสุด:  
    1
    จำเป็น

    Integer numbers.

  • messages
    ประเภท: array object[] · ClaudeMessage[] 1…
    จำเป็น
    • content
      จำเป็น
      • ประเภท: string
    • role
      ประเภท: string enum
      จำเป็น
      ค่า
      • user
      • assistant
    • propertyName
      ประเภท: anything
  • model
    ประเภท: string
    จำเป็น
  • metadata
    ประเภท: object
    • propertyName
      ประเภท: anything
  • service_tier
    ประเภท: string | null

    ขณะนี้รองรับเฉพาะ default (standard) เท่านั้น ค่าที่ไม่ระบุ ค่า null ชื่อแทน และสตริงที่ไม่รองรับจะถูกแทนด้วย default ส่วนประเภทอื่นจะคืน HTTP 400 ช่องทางและราคาที่กำหนดค่าไว้ยังคงเดิม API ข้อความจะส่งค่ามาตรฐานของผู้ให้บริการ ส่วน Decisions และ API การสร้างผลงานจะไม่ส่งฟิลด์ต้นทางนี้

  • 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 หรือการตอบกลับแบบสตรีมมิ่ง

    • content
      ประเภท: array object[] · ClaudeContentBlock[]
      จำเป็น
      • type
        ประเภท: string enum
        จำเป็น
        ค่า
        • 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
      const:  
      assistant
      จำเป็น
    • stop_reason
      ประเภท: string | null
      จำเป็น
    • type
      const:  
      message
      จำเป็น
    • stop_sequence
      ประเภท: string | null
    • usage
      ประเภท: object · Usage

      ออบเจ็กต์การใช้งานของผู้ให้บริการ ฟิลด์แตกต่างกันตาม endpoint และผู้ให้บริการ

      • propertyName
        ประเภท: anything
    • propertyName
      ประเภท: anything
  • 400
    ประเภท: object · ClaudeErrorResponse

    ข้อผิดพลาด invalid_request_error ของ Claude หรือข้อผิดพลาดจากการตรวจสอบคำขอของ Router

    ซองข้อผิดพลาดที่เข้ากันได้กับ Claude Errors API สำหรับคำขอ Messages

    • error
      ประเภท: object
      จำเป็น
      • message
        ประเภท: string
        จำเป็น
      • type
        ประเภท: string
        จำเป็น
      • propertyName
        ประเภท: anything
    • type
      const:  
      error
      จำเป็น
    • request_id
      ประเภท: string
    • propertyName
      ประเภท: anything
    application/json
  • 401
    ประเภท: object · ClaudeErrorResponse

    คีย์ API ของ Felo ไม่ถูกต้องหรือไม่มี

    ซองข้อผิดพลาดที่เข้ากันได้กับ Claude Errors API สำหรับคำขอ Messages

    • error
      ประเภท: object
      จำเป็น
      • message
        ประเภท: string
        จำเป็น
      • type
        ประเภท: string
        จำเป็น
      • propertyName
        ประเภท: anything
    • type
      const:  
      error
      จำเป็น
    • request_id
      ประเภท: string
    • propertyName
      ประเภท: anything
    application/json
  • 402
    ประเภท: object · ClaudeErrorResponse

    ยอดคงเหลือไม่เพียงพอ

    ซองข้อผิดพลาดที่เข้ากันได้กับ Claude Errors API สำหรับคำขอ Messages

    • error
      ประเภท: object
      จำเป็น
      • message
        ประเภท: string
        จำเป็น
      • type
        ประเภท: string
        จำเป็น
      • propertyName
        ประเภท: anything
    • type
      const:  
      error
      จำเป็น
    • request_id
      ประเภท: string
    • propertyName
      ประเภท: anything
    application/json
  • 403
    ประเภท: object · ClaudeErrorResponse

    บัญชีไม่ได้รับอนุญาตให้ใช้โมเดลนี้ โมเดลที่ปิดใช้งานจะถูกปฏิเสธก่อนเรียกต้นทางเช่นกัน คำขอและงานที่รับไว้แล้วยังคงดำเนินการต่อ

    ซองข้อผิดพลาดที่เข้ากันได้กับ Claude Errors API สำหรับคำขอ Messages

    • error
      ประเภท: object
      จำเป็น
      • message
        ประเภท: string
        จำเป็น
      • type
        ประเภท: string
        จำเป็น
      • propertyName
        ประเภท: anything
    • type
      const:  
      error
      จำเป็น
    • request_id
      ประเภท: string
    • propertyName
      ประเภท: anything
    application/json
  • 429
    ประเภท: object · ClaudeErrorResponse

    ถึงขีดจำกัดการใช้จ่ายหรือจำนวนคำขอแล้ว

    ซองข้อผิดพลาดที่เข้ากันได้กับ Claude Errors API สำหรับคำขอ Messages

    • error
      ประเภท: object
      จำเป็น
      • message
        ประเภท: string
        จำเป็น
      • type
        ประเภท: string
        จำเป็น
      • propertyName
        ประเภท: anything
    • type
      const:  
      error
      จำเป็น
    • request_id
      ประเภท: string
    • propertyName
      ประเภท: anything
    application/json
  • 502
    ประเภท: object · ClaudeErrorResponse

    คำขอไปยังผู้ให้บริการต้นทางล้มเหลว

    ซองข้อผิดพลาดที่เข้ากันได้กับ Claude Errors API สำหรับคำขอ Messages

    • error
      ประเภท: object
      จำเป็น
      • message
        ประเภท: string
        จำเป็น
      • type
        ประเภท: string
        จำเป็น
      • propertyName
        ประเภท: anything
    • type
      const:  
      error
      จำเป็น
    • request_id
      ประเภท: string
    • propertyName
      ประเภท: anything
    application/json
  • 503
    ประเภท: object · ClaudeErrorResponse

    ผู้ให้บริการหรือบริการเรียกเก็บเงินไม่พร้อมใช้งาน

    ซองข้อผิดพลาดที่เข้ากันได้กับ Claude Errors API สำหรับคำขอ Messages

    • error
      ประเภท: object
      จำเป็น
      • message
        ประเภท: string
        จำเป็น
      • type
        ประเภท: string
        จำเป็น
      • propertyName
        ประเภท: anything
    • type
      const:  
      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