Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
GuidesInference

Overview

The OpenRelay Inference API, with OpenAI-compatible chat completions and embeddings, an Anthropic-compatible Messages API, and typed decisions.

The OpenRelay Inference API is the entry point to OpenRelay's inference delivery network, a hosted inference gateway that speaks four API families: an OpenAI-compatible Chat Completions API, an Anthropic-compatible Messages API for models that support it, an OpenAI-compatible Embeddings API, and a Decisions API for typed classification. Point your existing OpenAI or Anthropic client at it, change the base URL and the API key, and your code works unchanged.

Base URL

All inference requests, including the Batch API, go to:

https://inference.openrelay.inc

This is a separate host from api.openrelay.inc, the control plane that manages VMs, pods, organizations, billing, and the model catalog. Both accept the same or_ API key; only the routes differ. If an inference call to api.openrelay.inc returns 404, you are on the wrong host.

Endpoints are versioned under /v1, mirroring the OpenAI API:

curl https://inference.openrelay.inc/v1/chat/completions \
  -H "Authorization: Bearer or_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openrelay/gpt-oss-120b",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'

What you get

  • OpenAI-compatible: the POST /v1/chat/completions request and response shapes match the OpenAI Chat Completions API, so existing SDKs and tools work as-is.
  • Anthropic-compatible, for models that support it: POST /v1/messages matches the Anthropic Messages API, so the Anthropic SDKs and Claude Code work as-is too. See Messages.
  • Embeddings: POST /v1/embeddings matches the OpenAI Embeddings API. See Embeddings.
  • Decisions: POST /v1/decisions answers typed questions (a choice, a score, or yes/no) about an input with probabilities and a confidence. See Decisions.
  • Streaming: set "stream": true for token-by-token Server-Sent Events, including a final chunk (Chat Completions) or message_delta/message_stop events (Messages) that report usage. See Streaming.
  • Prepaid, per-token billing: usage is metered per token with distinct input, cached-input, cache-write, and output rates (embeddings and decisions bill input only), and reported in every response's usage object. See Pricing & billing.

OpenRelay model ids

Requests and responses use OpenRelay's public model ids (for example openrelay/gpt-oss-120b). The model field in every response is always the public id you requested. See Models.

Three ways to call a model

Every model is priced per token, and the rate depends on how fast you need the answer:

TierHow it runsPrice vs SyncHow to call it
SyncReal time. The response (or stream) comes back on the request.Standard ratePOST /v1/chat/completions, /v1/messages, /v1/embeddings, /v1/decisions
AsyncQueued. Results are delivered later, not on the request.20% offComing soon, early access only. Email sales@openrelay.inc.
BatchA JSONL file of requests, completed within 24 hours.50% off at standard priorityPOST /v1/batches. See Batch API.

The discount applies to input, cached input, and output tokens alike. See Pricing & billing for the exact rules and a worked example.

Endpoints

EndpointAuthPurpose
POST /v1/chat/completionsAPI keyGenerate a chat completion (unary or streaming).
POST /v1/messagesAPI keyGenerate a message, Anthropic-shape (unary or streaming), for models that support it.
POST /v1/embeddingsAPI keyEmbed text as vectors, OpenAI-shape (unary). See Embeddings.
POST /v1/decisionsAPI keyAnswer typed questions about an input (unary). See Decisions.
GET /v1/modelsAPI keyList the models available to you.
POST /v1/batchesAPI keyRun a large job of requests asynchronously, at 50% off the Sync rate. See Batch API.
GET /healthznoneService health check.

Each model serves only the families it lists. Check a model's supported_apis field from GET /v1/models, and its endpoints map for the path to call. See Models.

Get started

On this page