Authentication
All requests use bearer API keys. Keys can be scoped to projects, models, endpoints, IP ranges, and monthly budgets.
Use scoped keys, predictable endpoints, and clear response metadata to integrate Open Ai into your own applications.
const response = await fetch("https://api.open-ai.dev/v1/responses", {
method: "POST",
headers: {
Authorization: "Bearer nx_live_your_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "orion-reason",
input: "Draft a migration checklist for a fintech API."
})
});
const result = await response.json();All requests use bearer API keys. Keys can be scoped to projects, models, endpoints, IP ranges, and monthly budgets.
Use /v1/responses for text, tools, JSON output, and multimodal inputs with unified usage metering.
Use /v1/embeddings for low-latency vector generation, cache-aware billing, and batched inputs.
Subscribe to invoice, wallet, rate-limit, key, and long-running request events with signed delivery.
/v1/responsesGenerate model output with text, JSON, tools, or multimodal input.
/v1/embeddingsCreate embeddings for search, retrieval, and clustering.
/v1/modelsList available models, price cards, latency bands, and capabilities.
/v1/usageQuery token, spend, latency, and request metrics by project or model.
/v1/webhooks/endpointsRegister signed webhook endpoints for billing and API events.
Route groups for marketing, auth, dashboard, admin, and API handlers.
Ledger-backed credits, usage events, scoped keys, invoices, support tickets.
Checkout sessions, wallet top-ups, invoices, and subscription plan metadata.
Rate limits, idempotency keys, model metadata cache, and API replay protection.
Session flow is wired locally and structured for Clerk or Auth.js production identity.
Zod-ready route handlers for marketplace, billing, admin, docs, and /v1 calls.
request_idmodelinput_tokensoutput_tokenswallet_debitcache_statuswallet.recharged
invoice.paid
key.revoked
usage.threshold_reached
request.completed
request.rate_limited