OpenAI compatibility

Inference HTTP routes follow OpenAI-style shapes so you can call them with standard clients if you handle x402 payments yourself. Using galliun is the recommended path.

Routes

Method Path Purpose
POST /v1/chat/completions Chat
POST /v1/embeddings Embeddings
GET /v1/models Model list
GET /v1/pricing Pricing catalog
POST /v1/auth/challenge Wallet auth challenge
POST /v1/auth/verify Wallet auth verify
* /v1/conversations Managed conversations

Base URL: https://api.galliun.com.

With the SDK

await client.inference.chat({ model: "openai:gpt-4o-mini", messages });
await client.inference.embeddings.create({ model: "...", input: "..." });
await client.inference.models.list();

You can also use PaidAIClient directly (client.inference.client()), which exposes nested helpers such as chat.completions.create.

Without the SDK

You must:

  1. Call the route
  2. Parse the 402 body (scheme: "exact")
  3. Pay USDC to the treasury address in accepts[]
  4. Retry with X-PAYMENT containing the proof

Prefer the SDK unless you are building a custom payment integration.

Streaming

Do not assume SSE streaming works end-to-end with the current SDK. Use non-streaming chat completions.