Avvio rapido
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. Ottieni la tua chiave API
Accedi e vai a Console → Chiavi API. Clicca "Crea chiave" e copiala subito - verrà mostrata una sola volta.
2. Effettua la tua prima richiesta
Scegli l'SDK che già usi. Entrambe le ricette raggiungono lo stesso gateway con la stessa chiave API.
Opzione A - SDK 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);Opzione B - SDK 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);L'SDK Anthropic aggiunge /v1/messages internamente. Usa l'origin del gateway (senza il suffisso /v1 ) come base_url - a differenza dell'SDK OpenAI, che accetta 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. Elenca i modelli disponibili
curl https://synthorai.io/v1/models \
-H "Authorization: Bearer YOUR_API_KEY" Gli ID dei modelli seguono il formato del provider originale. Puoi scoprire l'elenco completo con l'endpoint /v1/models oppure visitare la pagina Catalogo modelli .
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
Autenticazione
Tutte le richieste API richiedono una chiave API passata nell'header Authorization .
Bearer Token
Authorization: Bearer YOUR_API_KEY Scope della chiave
| Parametro | Tipo | Descrizione |
|---|---|---|
Read | string | Accesso solo all'elenco modelli e ai dati di utilizzo. |
Write | string | Esecuzione di richieste di inferenza (chat, completions). |
Admin | string | Accesso completo, inclusa la gestione di canali e utenti. |
Non esporre mai la chiave API in codice client-side o repository pubblici. In caso di compromissione, ruota subito le chiavi da Console → Chiavi API.
Formato della chiave
Le chiavi Synthorai hanno il prefisso sk- seguito da una stringa casuale di 32 caratteri. Le chiavi sono sottoposte a hashing a riposo e non possono essere recuperate dopo la creazione.
Non sai da quale modello iniziare? Sfoglia il model price comparison per confrontare fianco a fianco il prezzo per token di ogni modello instradabile.