Skip to content
BUILD WITH YOUR API

AI API documentation.
One connection.

Connect your application to the providers configured in your workspace.

OrvAPI gateway

Use the OrvAPI JSON API at https://api.orvapi.com. Requests use your four-hour and weekly allowance, drawn down at each model’s published input and output rate, including provider-reported cached input.

Start with the Claude Code or Codex CLI guide. For your own application, use the API example and SDK endpoints.

Get your API key

Create a key in API keys. Copy it when it is created; the full secret is shown only once. Keys start with orv_.

Authorization: Bearer YOUR_API_KEY

Keep the key on your application’s server. Revoking a key blocks subsequent requests made with it.

START HERE

Your account. Your key. Your coding client.

Connect Claude Code or Codex CLI to OrvAPI in three steps. Both use your OrvAPI allowance and model catalog.

  1. Create an account, then check your plan and allowance. If using the trial, complete Telegram verification in your dashboard.
  2. Create an API key. Copy it when shown and keep it private. Replace YOUR_ORVAPI_KEY in the examples with this key.
  3. Choose a configured model below. A model must have a provider route compatible with your client.

The examples configure your coding client. Your OrvAPI login password, ChatGPT subscription, and Claude subscription are not API keys. Never put a key in a shared repository.

01 / CLAUDE CODE

Connect Claude Code

Install Claude Code using its official installation guide. Open a terminal in your project and check claude --version.

Set the connection and launch

Claude uses the base address without /v1. These variables apply to the current terminal session; start Claude from that terminal. Use /status to confirm the gateway and credential.

Terminal

Automatic context management

The setup above asks Claude Code to compact around 64,000 tokens, using a 100,000-token compaction window at 64%. This changes when the client summarizes older turns; it does not lower the model’s actual context capacity. Update Claude Code if these settings are unavailable, and remove conflicting DISABLE_AUTO_COMPACT or DISABLE_COMPACT settings to enable automatic compaction. Keep persistent project rules in CLAUDE.md. Summaries can omit details; use a larger threshold when exact earlier text is essential.

Reference: Claude Code compaction settings.

Confirm it works

Ask “Reply with hello.” Then check request logs and usage in OrvAPI. A successful request should appear under the model you selected.

Keep the connection between sessions

Merge the env values into your user-level ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json). Preserve existing settings. A settings-file value overrides the same shell variable.

User settings · JSON

Reference: Claude Code gateway configuration.

02 / CODEX CLI

Connect Codex CLI

Follow the official Codex CLI installation guide, then check codex --version.

Add a custom provider

In your user-level ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml), merge this provider block. If model_providers.orvapi exists, update it instead of adding it twice. Keep your other settings.

config.toml · provider

Set your key and launch

This launch selects OrvAPI for the current run while preserving your default provider. The base URL includes /v1, and the wire API is responses.

Terminal

The launch command sets automatic compaction at 64,000 tokens. The provider block selects client-managed compaction because native remote compaction is not verified. This still makes summary requests through OrvAPI; it does not mean offline processing. Preserve the original transcript and project instructions in AGENTS.md. Compaction uses tokens once to summarize older turns and can reduce repeated input on later calls; savings depend on the workload.

Reference: Codex compaction configuration.

Ask “Reply with hello.” Confirm the model in the CLI and look for the request in OrvAPI logs. Set the key again in each new terminal, or provide it through your own secret manager.

Reference: OpenAI custom provider configuration.

Image edits for administrators

Send POST /v1/images/edits with an administrator API key and a model listed in GET /v1/models with image input and output. Upload a PNG, JPEG or WebP using the multipart image field. Repeat image[] for multiple files, or send JSON with an images array of base64 data URLs in image_url fields. Requests support up to five references and 16 MB of image data. The limit depends on the selected model.

curl https://www.orvapi.com/v1/images/edits \
  -H "Authorization: Bearer $ORVAPI_API_KEY" \
  -F 'model=gpt-image-2' \
  -F 'prompt=Change the background to pale blue' \
  -F 'image=@reference.png'

If the model only has a text-to-image route, the endpoint returns image_reference_unavailable. Use POST /v1/images/generations for text-only artwork. Reference edits require an enabled image provider that accepts image input.

Connection troubleshooting

401 / invalid key
Use an active OrvAPI key and restart the client from the configured terminal. Revoke and replace an exposed key.
404 / wrong endpoint
Claude base URL has no /v1; Codex base URL ends with /v1. Neither uses /api/chat.
Unknown or unavailable model
Copy an exact configured ID from the catalog. Configured means listed, not guaranteed healthy or compatible with every protocol. Check with support if its native route is unavailable.
429 / allowance or request reservation
Check trial verification, plan expiry, and available allowance in the dashboard. A request may need a temporary reservation larger than the available funds even when confirmed spending is low. Check the required and available amounts in the error; reduce conversation size or the requested output limit. Rejected budget checks are not charged.
Client still uses another account
Launch from the same terminal. In Claude, remove conflicting gateway credential settings and inspect /status. In Codex, include the provider override shown above. Organization-managed settings may restrict custom providers.
Images or compaction fail
Vision requires a working native or assisted route. Use the current setup commands to let the client compact its own history. Native remote compaction remains unverified. Existing installations must apply the updated settings and restart the client; an API key alone cannot change client configuration. Do not assume every client feature is available.

For support, include the client version, model, time, and request ID. Leave out API keys and private project content.

Make your first API request

Replace the key and model ID with values from your workspace.

Terminal · cURL
curl https://api.orvapi.com/api/chat \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"Hello!"}]}'

A successful response includes message, model, requestId, and usage with input, output, and total tokens. Review actual requests in Logs.

Models & token pricing

One catalog, one API. Use the exact model ID in your request. Configured models have an enabled provider; this is not a live health guarantee. Planned models become available after a provider is connected.

Model catalog · Standard credits per 1 million tokens
Model IDTierAvailabilityInputOutput
claude-fable-5-2Paid plans onlyMost capableConfigured8004,000
claude-fable-5-1Paid plans onlyMost capableConfigured520760
claude-fable-5Paid plans onlyMost capableConfigured520760
claude-haiku-4-5FastestConfigured200200
claude-opus-5-thinkingPaid plans onlyMost capableConfigured360600
claude-opus-5-5Paid plans onlyMost capableConfigured340440
claude-opus-5Most capableConfigured360600
claude-opus-4-8Most capableConfigured360520
claude-opus-4-7Most capableConfigured360520
claude-opus-4-6-thinkingPaid plans onlyMost capableConfigured360520
claude-opus-4-6Most capableConfigured360520
claude-sonnet-5-5BalancedConfigured260420
claude-sonnet-5BalancedConfigured260420
claude-sonnet-4-6BalancedConfigured225350
claude-sonnet-4-5BalancedConfigured225350
gpt-6.2-solPaid plans onlyMost capableConfigured440680
gpt-6.2-astraPaid plans onlyMost capableConfigured6051,010
gpt-6.1-solPaid plans onlyMost capableConfigured5002,100
gpt-6-solMost capableConfigured440680
gpt-6-reasoning-proPaid plans onlyMost capableConfigured6051,010
gpt-6-lunaFastestConfigured120140
gpt-6-astraPaid plans onlyMost capableConfigured6051,010
gpt-5.6-solMost capableConfigured440680
gpt-5.6-lunaFastestConfigured120140
gpt-5.5-proMost capableConfigured6001,800
gpt-5.5Most capableConfigured6001,800
gpt-5.4-miniFastestConfigured200210
gpt-5.4BalancedConfigured108135
gpt-5-5Most capableConfigured350600
gpt-oss-120bFastestConfigured108135
codex-auto-reviewBalancedConfigured125200
composer-2.5-fastFastestConfigured120140
deepseek-v4-proBalancedConfigured220340
deepseek-v4-flashFastestConfigured220340
deepseek-v4-1-flash-1017FastestConfigured220340
deepseek-v4-1-flashFastestConfigured220340
gemini-4-hydrogen-xhighPaid plans onlyMost capableConfigured6051,010
gemini-4-carbon-highPaid plans onlyMost capableConfigured6051,010
gemini-4-argon-highPaid plans onlyMost capableConfigured6051,010
gemini-4-argonPaid plans onlyMost capableConfigured6051,010
gemini-3.8-flash-highPaid plans onlyFastestConfigured200220
gemini-3.8-flashFastestConfigured200220
gemini-3.7-flashFastestConfigured200220
gemini-3.6-flashFastestConfigured200220
gemini-3.5-flash-litePaid plans onlyFastestConfigured200220
gemini-3.1-pro-previewBalancedConfigured225350
gemini-3.1-flash-litePaid plans onlyFastestConfigured200220
gemini-3-flashPaid plans onlyFastestConfigured200220
gemini-2.5-proBalancedConfigured225350
glm-5.3-primeMost capableConfigured400700
glm-5.3-flashFastestConfigured220340
glm-5.3Paid plans onlyBalancedConfigured220340
glm-5.2BalancedConfigured220340
glm-5-turboFastestConfigured200270
grok-4.7Paid plans onlyBalancedConfigured300700
grok-4.6BalancedConfigured130160
grok-4.5BalancedConfigured130160
grok-4-5BalancedConfigured300400
hy4-previewBalancedConfigured200220
kimi-k3BalancedConfigured340580
kimi-k2.7-codeBalancedConfigured200210
mimo-v2.6-flashFastestConfigured120140
mimo-v2.5FastestConfigured120140
minimax-m3.1-flashFastestConfigured120140
minimax-m3BalancedConfigured120140
qwen-3.5-397b-a17bMost capableConfigured400700
qwen-maxMost capableConfigured400700
qwen-plusBalancedConfigured300500
qwen-turboFastestConfigured300400
qwen3.8-max-0902Most capableConfigured385570
qwen3.8-flash-nextFastestConfigured200220

Rates are per model. Input and output use the same standard credit allowance. Rates are listed per million tokens, and each request uses credits based on the tokens it actually consumes. Cached input counts as input. Requests on premium routes also use premium credits.

For example, 300,000 input tokens plus 500,000 output tokens on claude-opus-5 costs $0.48 + $2.00 = $2.48. Your plan’s dollar price and four-hour and weekly limits remain unchanged. Planned models cannot be requested or billed yet. A configured model with no published rate bills at $1.666667 per million each way until its rate is listed.

Read the current catalog from GET /api/models. This public endpoint returns configured model IDs and each model’s tier and per-million input and output rate, without provider details.

When multiple providers offer the same model, OrvAPI tries another matching provider if the first cannot answer. Customer usage is charged once for the successful response.

The request contract

POSThttps://api.orvapi.com/api/chat
model
Required. An enabled model ID.
messages
Required. 1–30 user/assistant messages, ending with a user message. Each message contains role and content. A single message may be as large as the request body allows.
provider
Optional preferred provider ID, configured by your administrator.
Limits
8 MB request body, up to 8,192 output tokens (2,048 by default), 60 requests per minute on Starter, Builder and Pro; 80 on Scale, Ultra and Power; 200 on active Unlimited; and 8 concurrent requests per account. RPM is shared across all of your API keys and API formats. Provider capacity and plan usage allowances are separate limits.
Client applications maintain their own conversation history. Chat history in the dashboard is saved to your account. Do not automatically retry timed-out requests: the provider may already have performed billable work.

SDK-compatible endpoints

Use POST /v1/messages for Anthropic Messages, POST /v1/responses for Responses, or POST /v1/chat/completions for OpenAI-style text requests. These endpoints use your OrvAPI API key and the same allowance, model routing and billing. GET /v1/models lists configured models.

Authentication: send Authorization: Bearer YOUR_API_KEY or x-api-key: YOUR_API_KEY. For the OpenAI SDK, set base_url to https://api.orvapi.com/v1. For the Anthropic SDK, set base_url to https://api.orvapi.com.

Messages and Responses preserve native tool calls, tool results, thinking blocks and streaming, with an 8 MB request limit. Image support depends on a working native or verified assisted-vision route. Chat Completions shares the same 8 MB request limit but supports text only, at most 30 messages and 8,192 output tokens, and ignores reasoning_effort; it rejects tools, response_format and n above 1. Use Messages or Responses for images, tools, extended thinking and coding clients.

Set stream: true to receive text as the provider generates it. Failover is possible before the first text chunk; once output starts, a failed stream ends with an error rather than switching models or replaying text. Usage is finalized after the provider supplies its usage totals. Interrupted requests may retain a reservation for review.

Images & assisted vision

Attach images in dashboard chat, send Anthropic image blocks to /v1/messages, or send input_image blocks to /v1/responses. Use JPEG, PNG, WebP or GIF. A working vision route must be available.

Verified native routes receive the original image. For other models, an available verified vision model can describe the image first; your selected model then answers using that description. This is assisted vision: fine visual details and precise coordinates may be lost. Up to eight images can be analyzed in one assisted request. If no verified helper exists, images are passed to the selected native route without a claim that it supports vision.

Image descriptions remain within the request and are reused during failover. The service covers the helper model’s processing cost; the selected model’s reported usage, including the description as input, counts toward your allowance. Token-counting requests never trigger paid image analysis.

Understand the response

400
Invalid JSON, model, or message format.
401
Missing, invalid, or revoked API key.
429
Rate limit, provider quota, or available allowance reached.
503
OrvAPI is temporarily unavailable. The error includes the API base URL, never an upstream provider URL.
504
The provider did not finish within 90 seconds.

Error responses contain an error.message. Unknown provider usage may retain its reservation for review.

Before generation, OrvAPI reserves an estimate for input plus the maximum requested output at the selected model’s published rates. This temporary reservation is not the final charge. Reported usage settles the cost and releases unused funds. Confirmed spending and pending reservations appear separately in your dashboard. If a single request needs more than your entire four-hour limit, waiting for that limit to reset will not make the same request fit; use a smaller request or contact support if the estimate looks incorrect. Do not repeatedly retry an unchanged budget rejection.

YOUR NEXT REQUEST

Ready when you are.

Create an API key