Guides
Protocols and SDKs
Use OpenAI-compatible, Responses, and Anthropic Messages protocols, including streaming, tool calls, and migration.
The Model API speaks three wire protocols. Keep your existing SDK and change the base URL, API key, and model ID.
Endpoint matrix
| Protocol | Endpoint | Typical client |
|---|---|---|
| OpenAI Chat Completions | POST https://openapi.felo.ai/api/v1/chat/completions | OpenAI SDK, most OpenAI-compatible tools |
| OpenAI Responses | POST https://openapi.felo.ai/api/v1/responses | OpenAI SDK with Responses API features |
| Anthropic Messages | POST https://openapi.felo.ai/api/v1/messages | Anthropic SDK, Claude Code, Claude-native tools |
Base URLs
| Client | Base URL | Why |
|---|---|---|
| OpenAI SDK | https://openapi.felo.ai/api/v1 | The SDK appends /chat/completions or /responses |
| Anthropic SDK | https://openapi.felo.ai/api | The SDK appends /v1/messages; do not add /v1 yourself |
Both clients use your Felo API key as the SDK API key.
import OpenAI from "openai";
import Anthropic from "@anthropic-ai/sdk";
const openai = new OpenAI({
apiKey: process.env.FELO_API_KEY,
baseURL: "https://openapi.felo.ai/api/v1",
});
const anthropic = new Anthropic({
apiKey: process.env.FELO_API_KEY,
baseURL: "https://openapi.felo.ai/api",
});Choose a protocol
- Use Chat Completions when your tool or SDK expects the familiar
messagesarray andchoices[0].message.content. - Use Responses when you need OpenAI's Responses object,
input,instructions, oroutput_text. - Use Messages when you are using an Anthropic SDK or a Claude-native tool.
Check the model before assuming every protocol works. The catalog exposes supported_protocols, supported_parameters, and a recommended_protocol. recommended_protocol is a client recommendation, not a restriction; a model may still accept another protocol.
Streaming
Set stream: true to receive Server-Sent Events.
- Chat Completions emits OpenAI-style chat chunks.
- Responses emits Responses SSE events and ends with a completed response object.
- Messages emits Anthropic message stream events.
Read the event stream incrementally and handle the terminal event before closing the connection. A dropped connection is not the same as a completed response.
Tool calls and structured output
Pass tools in the protocol's native shape. Support varies by model, so check supported_parameters in the catalog before relying on tool calls, JSON mode, or structured output. A model can accept the field and still ignore an unsupported option.
Channel routing
All three endpoints accept X-Felo-Channel when you need to pin a provider. See Channels and Provider Routing for the header rules and examples.
Migrate from an official API
- Change the base URL to the matching Felo URL.
- Replace the API key with
FELO_API_KEY. - Replace the model name with the public Felo model ID.
- Keep the rest of the request shape.
| Symptom | Likely cause |
|---|---|
| 404 on every request | Base URL already includes /v1, or the Anthropic base URL has /v1 added manually |
| 401 | The Felo key is missing or the client is still sending the old key |
400 model error | The model ID is not public or does not support the chosen endpoint |
| Messages request rejected | max_tokens is required by the Messages protocol |
| Tool call ignored | The model does not advertise that capability |