Inicio rápido
From signing in to a working integration. Each step takes a minute or two, and you can stop after step 3 if all you need is one call.
What you are about to do - Get a key, prove it works without writing code, wire it into your app, then keep it topped up. Where a welcome campaign is running you can do the first calls on free credit; otherwise a small top-up comes first.
1. Obtén tu clave API
Inicia sesión y ve a Consola → Claves API. Haz clic en «Crear clave» y cópiala de inmediato - solo se mostrará una vez.
2. Haz tu primera solicitud
Elige el SDK que ya usas. Ambas recetas llaman al mismo gateway con la misma clave API.
Opción A - SDK de OpenAI
curl https://synthorai.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-5.4-mini",
"messages": [
{"role": "user", "content": "Hello! What can you do?"}
]
}'from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://synthorai.io/v1"
)
response = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hello! What can you do?"}]
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_API_KEY",
baseURL: "https://synthorai.io/v1",
});
const response = await client.chat.completions.create({
model: "gpt-5.4-mini",
messages: [{ role: "user", content: "Hello! What can you do?" }],
});
console.log(response.choices[0].message.content);Opción B - SDK de Anthropic
curl https://synthorai.io/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 256,
"messages": [
{"role": "user", "content": "Hello! What can you do?"}
]
}'from anthropic import Anthropic
client = Anthropic(
api_key="YOUR_API_KEY",
base_url="https://synthorai.io"
)
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=256,
messages=[{"role": "user", "content": "Hello! What can you do?"}]
)
print(message.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "YOUR_API_KEY",
baseURL: "https://synthorai.io",
});
const message = await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 256,
messages: [{ role: "user", content: "Hello! What can you do?" }],
});
console.log(message.content[0].text);El SDK de Anthropic añade /v1/messages internamente. Use el origen de la pasarela (sin /v1 como sufijo) base_url - a diferencia del SDK de OpenAI, que toma https://synthorai.io/v1.
3. Try it without writing code
Open the Playground in the console, pick a model and send a prompt. It runs through the same pipeline as your API traffic, so a reply confirms the model and your balance. It authenticates with your console session rather than an API key, so test the key itself with the request above.
4. Lista los modelos disponibles
curl https://synthorai.io/v1/models \
-H "Authorization: Bearer YOUR_API_KEY" Los ID de modelo siguen el formato del proveedor original. Puedes ver la lista completa con el endpoint /v1/models o visita la página Catálogo de modelos .
5. Wire it into your app
Point your existing client at the gateway: change the base URL and use your Synthorai key. Your model ids, request shapes and SDKs stay as they are. From there the capability guides cover the things that change your bill - caching a repeated prefix, or capping how much a model thinks.
Using Claude Code, Codex CLI or OpenClaw instead of an SDK? Those have their own one-line setup:
6. Add credit when you need it
Usage draws down a prepaid balance - no monthly platform fee, no subscription. Top up from Billing with a card or crypto; the balance is usable the moment it lands. Free credit comes from a welcome campaign where one is running, not automatically on signup.
Where to go next
- Prompt caching - bill a repeated prefix at a fraction of its normal price
- Reasoning effort - the biggest cost lever on models that reason by default
- API keys - quotas, model allowlists, expiry and rotation
- Usage analytics - where the spend actually went
Autenticación
Todas las solicitudes de la API requieren una clave API pasada en el Authorization encabezado.
Token Bearer
Authorization: Bearer YOUR_API_KEY Ámbitos de la clave
| Parámetro | Tipo | Descripción |
|---|---|---|
Read | string | Acceso solo a la lista de modelos y los datos de uso. |
Write | string | Realizar solicitudes de inferencia (chat, completions). |
Admin | string | Acceso completo, incluida la gestión de canales y usuarios. |
Nunca expongas tu clave API en código del lado del cliente ni en repositorios públicos. Rota las claves de inmediato si se ven comprometidas mediante Consola → Claves API.
Formato de la clave
Las claves de Synthorai llevan el prefijo sk- seguido de una cadena aleatoria de 32 caracteres. Las claves se cifran (hash) en reposo y no se pueden recuperar después de su creación.
¿No sabes con qué modelo empezar? Explora la model price comparison para ver el precio por token de cada modelo enrutable en paralelo.