Felo API PlatformFelo API Platform
v0.4.0
OpenAPI 3.1.0

Creare un messaggio Claude

Server:https://openapi.felo.ai
Librerie client

Creare un messaggio Claude

​

Endpoint compatibile con l'API Claude Messages. Impostare stream=true per ricevere eventi di streaming dei messaggi in stile Claude. I campi di richiesta, risposta ed errore di convalida seguono il protocollo Claude Messages; per guasti dell'infrastruttura il Router può anche restituire una struttura di errore del gateway depurata.

Intestazioni
  • X-Felo-Channel
    Tipo: string

    Codici canale pubblici separati da virgola e in ordine. Omettere questa intestazione per usare default; default deve essere usato da solo. In modalità wallet, default analizza in ordine inverso l'ordine effettivo dei canali pubblici del modello, ignora i canali non pubblicati o non disponibili e seleziona il provider del primo canale disponibile. Include gli endpoint disponibili di quel provider con lo stesso ID modello upstream e lo stesso livello di servizio. I canali espliciti vengono convalidati nell'ordine indicato dal client; viene inviato solo il gruppo di provider del primo canale. Nessun fallback automatico ad altri provider. Le intestazioni dei provider legacy non possono ignorare l'instradamento dei canali.

Corpo·ClaudeMessagesRequest
obbligatorio
application/json
  • max_tokens
    Tipo: integer
    min:  
    1
    obbligatorio

    Integer numbers.

  • messages
    Tipo: array object[] · ClaudeMessage[] 1…
    obbligatorio
    • content
      obbligatorio
      • Tipo: string
    • role
      Tipo: string enum
      obbligatorio
      valori
      • user
      • assistant
    • propertyName
      Tipo: anything
  • model
    Tipo: string
    obbligatorio
  • metadata
    Tipo: object
    • propertyName
      Tipo: anything
  • service_tier
    Tipo: string | null

    Attualmente è supportato solo default (standard). Se omesso, null, alias e stringhe non supportate ricadono su default; altri tipi restituiscono HTTP 400. I canali e i prezzi configurati restano invariati. Le API di testo inviano il valore standard del provider; le API Decisions e di generazione omettono il campo upstream.

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

    Integer numbers.

  • top_p
    Tipo: number
    min:  
    0
    max:  
    1
  • propertyName
    Tipo: anything
Risposte
  • 200
    Tipo: object · ClaudeMessageResponse

    Messaggio Claude o risposta in streaming

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

      Oggetto di utilizzo del provider. I campi variano in base all'endpoint e al provider.

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

    invalid_request_error di Claude o errore di convalida della richiesta del Router

    Struttura di errore compatibile con l'API Claude Errors per le richieste Messages.

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

    Chiave API Felo non valida o mancante

    Struttura di errore compatibile con l'API Claude Errors per le richieste Messages.

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

    Saldo insufficiente

    Struttura di errore compatibile con l'API Claude Errors per le richieste Messages.

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

    L'account non è autorizzato a usare il modello. Anche i modelli disattivati vengono rifiutati prima delle chiamate upstream. Le richieste e le attività già accettate proseguono.

    Struttura di errore compatibile con l'API Claude Errors per le richieste Messages.

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

    Limite di spesa o di richieste raggiunto

    Struttura di errore compatibile con l'API Claude Errors per le richieste Messages.

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

    Richiesta al provider upstream non riuscita

    Struttura di errore compatibile con l'API Claude Errors per le richieste Messages.

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

    Provider o servizio di fatturazione non disponibile

    Struttura di errore compatibile con l'API Claude Errors per le richieste Messages.

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