Gateway
Get an API key and send your first chat completions request.
The Syzygy Gateway is an OpenAI-compatible API. If you have used the OpenAI API before, you already know how to use it. You need two things: an API key and the base URL.
https://inference.withsyzygy.com/v11. Get your API key
- Sign in at app.withsyzygy.com.
- Open your workspace and click API Keys in the sidebar.
- Click Generate Key, give the key a name, and confirm.
- Copy the key. It is shown only once. If you lose it, generate a new one.
Keep the key private. Anyone who has it can make requests billed to your workspace.
2. Send a chat completions request
Put the key in the Authorization header as a bearer token and post to
/v1/chat/completions:
curl https://inference.withsyzygy.com/v1/chat/completions \
-H "Authorization: Bearer $SYZYGY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{ "role": "user", "content": "Say hello." }]
}'The response is the standard OpenAI shape. The reply text is in
choices[0].message.content:
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "openai/gpt-4o-mini",
"provider": "openai",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello!" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 9, "completion_tokens": 2, "total_tokens": 11 }
}That's it. Everything below is optional.
Use the OpenAI SDK
Point any OpenAI client at the gateway by changing its base URL and key.
from openai import OpenAI
client = OpenAI(
base_url="https://inference.withsyzygy.com/v1",
api_key="YOUR_SYZYGY_API_KEY",
)
completion = client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Say hello."}],
)
print(completion.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://inference.withsyzygy.com/v1",
apiKey: "YOUR_SYZYGY_API_KEY",
});
const completion = await client.chat.completions.create({
model: "openai/gpt-4o-mini",
messages: [{ role: "user", content: "Say hello." }],
});
console.log(completion.choices[0]?.message.content);Stream the reply
Add "stream": true to get tokens as they are generated. The response is a
stream of server-sent events, ending with data: [DONE].
curl https://inference.withsyzygy.com/v1/chat/completions \
-H "Authorization: Bearer $SYZYGY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{ "role": "user", "content": "Count to five." }],
"stream": true
}'Pick a model
Model IDs are provider/model, for example openai/gpt-4o-mini or
anthropic/claude-3-5-haiku. List everything available, with pricing and
context window, with one request:
curl https://inference.withsyzygy.com/v1/models \
-H "Authorization: Bearer $SYZYGY_API_KEY"If something goes wrong
Errors use the OpenAI error format: { "error": { "message", "type", "code" } }.
| Status | Meaning | What to do |
|---|---|---|
401 | Missing or invalid key | Check the Authorization: Bearer header and that the key was not deleted. |
402 | Out of credits | Add credits under Billing in the dashboard. |
429 | Rate limited | Wait and retry. The x-ratelimit-reset header says when. |
Full API contract
The complete, machine-readable OpenAPI spec is published at inference.withsyzygy.com/openapi.json. It covers every endpoint, request field, and response shape.