Felo API PlatformFelo API Platform
v0.4.0
OpenAPI 3.1.0

Utwórz wiadomość Claude

Serwer:https://openapi.felo.ai
Biblioteki klienckie

Utwórz wiadomość Claude

​

Endpoint zgodny z Claude Messages API. Ustaw stream=true, aby otrzymywać zdarzenia strumienia wiadomości w stylu Claude. Pola żądania, odpowiedzi i błędów walidacji są zgodne z protokołem Claude Messages; router może również zwrócić oczyszczoną kopertę błędu bramy w przypadku awarii infrastruktury.

Nagłówki
  • X-Felo-Channel
    Typ: string

    Uporządkowane kody publicznych kanałów rozdzielone przecinkami. Pomiń ten nagłówek, aby użyć wartości domyślnej; wartość domyślna musi być używana samodzielnie. W trybie portfela wartość domyślna przegląda efektywną kolejność publicznych kanałów modelu od końca, pomija kanały nieopublikowane lub niedostępne i wybiera dostawcę pierwszego dostępnego kanału. Obejmuje dostępne endpointy tego dostawcy o tym samym identyfikatorze modelu upstream i tym samym poziomie usługi. Jawne kanały są weryfikowane w kolejności podanej przez klienta; przesyłana jest tylko grupa dostawcy pierwszego kanału. Brak automatycznego przełączania na innych dostawców. Przestarzałe nagłówki dostawcy nie mogą nadpisać routingu kanałów.

Treść·ClaudeMessagesRequest
wymagane
application/json
  • max_tokens
    Typ: integer
    min.:  
    1
    wymagane

    Integer numbers.

  • messages
    Typ: array object[] · ClaudeMessage[] 1…
    wymagane
    • content
      wymagane
      • Typ: string
    • role
      Typ: string enum
      wymagane
      wartości
      • user
      • assistant
    • propertyName
      Typ: anything
  • model
    Typ: string
    wymagane
  • metadata
    Typ: object
    • propertyName
      Typ: anything
  • service_tier
    Typ: string | null

    Obecnie obsługiwana jest tylko wartość default (standard). Pominięcie, null, aliasy i nieobsługiwane ciągi znaków powodują powrót do wartości default; inne typy zwracają HTTP 400. Skonfigurowane kanały i ceny pozostają bez zmian. Interfejsy API modeli tekstowych wysyłają standardową wartość dostawcy; interfejsy Decisions i generowania pomijają pole upstream.

  • stop_sequences
    Typ: array string[]
  • stream
    Typ: boolean
  • system
    • Typ: string
  • temperature
    Typ: number
    min.:  
    0
    maks.:  
    1
  • thinking
    Typ: object
    • propertyName
      Typ: anything
  • tool_choice
    • Typ: string
  • tools
    Typ: array object[]
    • propertyName
      Typ: anything
  • propertyName
    Typ: anything
  • top_k
    Typ: integer
    min.:  
    0

    Integer numbers.

  • top_p
    Typ: number
    min.:  
    0
    maks.:  
    1
  • propertyName
    Typ: anything
Odpowiedzi
  • 200
    Typ: object · ClaudeMessageResponse

    Wiadomość Claude lub odpowiedź strumieniowa

    • content
      Typ: array object[] · ClaudeContentBlock[]
      wymagane
      • type
        Typ: string enum
        wymagane
        wartości
        • text
        • image
        • document
        • tool_use
        • tool_result
        • thinking
      • content
        Typ: string | array
      • id
        Typ: string
      • input
        Typ: object
        • propertyName
          Typ: anything
      • name
        Typ: string
      • source
        Typ: object
        • propertyName
          Typ: anything
      • text
        Typ: string
      • propertyName
        Typ: anything
    • id
      Typ: string
      wymagane
    • model
      Typ: string
      wymagane
    • role
      const:  
      assistant
      wymagane
    • stop_reason
      Typ: string | null
      wymagane
    • type
      const:  
      message
      wymagane
    • stop_sequence
      Typ: string | null
    • usage
      Typ: object · Usage

      Obiekt użycia dostawcy. Pola różnią się w zależności od endpointu i dostawcy.

      • propertyName
        Typ: anything
    • propertyName
      Typ: anything
  • 400
    Typ: object · ClaudeErrorResponse

    Błąd invalid_request_error Claude lub błąd walidacji żądania routera

    Koperta błędu zgodna z Claude Errors API dla żądań Messages.

    • error
      Typ: object
      wymagane
      • message
        Typ: string
        wymagane
      • type
        Typ: string
        wymagane
      • propertyName
        Typ: anything
    • type
      const:  
      error
      wymagane
    • request_id
      Typ: string
    • propertyName
      Typ: anything
    application/json
  • 401
    Typ: object · ClaudeErrorResponse

    Nieprawidłowy lub brakujący klucz API Felo

    Koperta błędu zgodna z Claude Errors API dla żądań Messages.

    • error
      Typ: object
      wymagane
      • message
        Typ: string
        wymagane
      • type
        Typ: string
        wymagane
      • propertyName
        Typ: anything
    • type
      const:  
      error
      wymagane
    • request_id
      Typ: string
    • propertyName
      Typ: anything
    application/json
  • 402
    Typ: object · ClaudeErrorResponse

    Niewystarczające saldo

    Koperta błędu zgodna z Claude Errors API dla żądań Messages.

    • error
      Typ: object
      wymagane
      • message
        Typ: string
        wymagane
      • type
        Typ: string
        wymagane
      • propertyName
        Typ: anything
    • type
      const:  
      error
      wymagane
    • request_id
      Typ: string
    • propertyName
      Typ: anything
    application/json
  • 403
    Typ: object · ClaudeErrorResponse

    Konto nie ma uprawnień do korzystania z modelu. Wyłączone modele są również odrzucane przed wywołaniami upstream. Istniejące przyjęte żądania i zadania są kontynuowane.

    Koperta błędu zgodna z Claude Errors API dla żądań Messages.

    • error
      Typ: object
      wymagane
      • message
        Typ: string
        wymagane
      • type
        Typ: string
        wymagane
      • propertyName
        Typ: anything
    • type
      const:  
      error
      wymagane
    • request_id
      Typ: string
    • propertyName
      Typ: anything
    application/json
  • 429
    Typ: object · ClaudeErrorResponse

    Osiągnięto limit wydatków lub żądań

    Koperta błędu zgodna z Claude Errors API dla żądań Messages.

    • error
      Typ: object
      wymagane
      • message
        Typ: string
        wymagane
      • type
        Typ: string
        wymagane
      • propertyName
        Typ: anything
    • type
      const:  
      error
      wymagane
    • request_id
      Typ: string
    • propertyName
      Typ: anything
    application/json
  • 502
    Typ: object · ClaudeErrorResponse

    Żądanie do dostawcy upstream nie powiodło się

    Koperta błędu zgodna z Claude Errors API dla żądań Messages.

    • error
      Typ: object
      wymagane
      • message
        Typ: string
        wymagane
      • type
        Typ: string
        wymagane
      • propertyName
        Typ: anything
    • type
      const:  
      error
      wymagane
    • request_id
      Typ: string
    • propertyName
      Typ: anything
    application/json
  • 503
    Typ: object · ClaudeErrorResponse

    Dostawca lub usługa rozliczeniowa niedostępna

    Koperta błędu zgodna z Claude Errors API dla żądań Messages.

    • error
      Typ: object
      wymagane
      • message
        Typ: string
        wymagane
      • type
        Typ: string
        wymagane
      • propertyName
        Typ: anything
    • type
      const:  
      error
      wymagane
    • request_id
      Typ: string
    • propertyName
      Typ: 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