oxDocs
Browse documentation
Introduction
Vision API
Inference API
Realtime
Integrations
LiveKit & SIP
Administration
Reference

Get started

HTTP API quickstart

Make a verified request with curl, JavaScript, or Python against the current preview API.

List the models enabled for your project

Start with GET /v1/models. This verifies the API origin and credential without spending an inference request.

bash

curl --fail-with-body "$OX_API_BASE_URL/v1/models" \
  --header "Authorization: Bearer $OX_API_KEY" \
  --header "Accept: application/json"

The response is an OpenAI-compatible list. Choose an ID returned for your project rather than copying a model name from a model card or another account.

json

{
  "object": "list",
  "data": [{ "id": "MODEL_ID", "object": "model" }]
}

Create a chat completion

Replace MODEL_ID with an ID from the list response. The smallest useful request contains a model and one user message.

bash

curl --fail-with-body "$OX_API_BASE_URL/v1/chat/completions" \
  --header "Authorization: Bearer $OX_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"model":"MODEL_ID","messages":[{"role":"user","content":"Describe what you can help with in one sentence."}],"temperature":0}'

Read the answer from choices[0].message.content. Preserve the x-request-id response header in server logs when reporting a failed request, but never log the authorization header or media bytes.

Use an OpenAI-compatible client

Existing OpenAI client libraries can target Ox by setting their base URL to the preview origin plus /v1. Ox-specific reusable-media helpers and Realtime transport helpers remain in @ox/sdk.

bash

npm install openai
# Or: python -m pip install openai
JavaScript

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OX_API_KEY,
  baseURL: (process.env.OX_API_BASE_URL ?? "https://www.amerint.co") + "/v1",
});

const models = await client.models.list();
const model = models.data[0];
if (!model) throw new Error("No models are enabled for this project");

const completion = await client.chat.completions.create({
  model: model.id,
  messages: [{ role: "user", content: "Reply with a short hello." }],
});
console.log(completion.choices[0]?.message.content);
python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["OX_API_KEY"],
    base_url=os.getenv("OX_API_BASE_URL", "https://www.amerint.co") + "/v1",
)

models = client.models.list()
if not models.data:
    raise RuntimeError("No models are enabled for this project")

completion = client.chat.completions.create(
    model=models.data[0].id,
    messages=[{"role": "user", "content": "Reply with a short hello."}],
)
print(completion.choices[0].message.content)
Help improve this guideFound something unclear or incomplete?
Report an issue ↗View source ↗