SyzygyDocs

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/v1

1. Get your API key

  1. Sign in at app.withsyzygy.com.
  2. Open your workspace and click API Keys in the sidebar.
  3. Click Generate Key, give the key a name, and confirm.
  4. 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.

Python
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)
TypeScript
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" } }.

StatusMeaningWhat to do
401Missing or invalid keyCheck the Authorization: Bearer header and that the key was not deleted.
402Out of creditsAdd credits under Billing in the dashboard.
429Rate limitedWait 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.

On this page