A unified Base URL lets tools like Claude Code, Codex CLI and Cursor connect to the same OpenAI-compatible API gateway when the tool supports custom endpoints. With RutaAPI, the Base URL is https://api.rutaapi.com/v1. You still need a valid RutaAPI API key, enough prepaid credits, and a model name returned by /v1/models. A unified Base URL reduces endpoint confusion, but each tool may still require its own provider or environment variable format.
Before you start
You need a RutaAPI account, a prepaid credit pack, and an API key. Make sure your account has credits before making requests — requests without sufficient credits will return a 401 or 403 error.
What a unified Base URL means An OpenAI-compatible Base URL is the root address of the API gateway that your client points to. Using the same root for multiple tools means one endpoint, one API key format, and one set of model names — rather than configuring each tool separately with different provider addresses.
RutaAPI Base URL The correct RutaAPI Base URL is <strong>https://api.rutaapi.com/v1</strong>. Always include the /v1 path. Do not use https://rutaapi.com, https://app.rutaapi.com, or any path that ends in /chat/completions as the Base URL — those are not the API root.
What NOT to enter as Base URL Avoid using the dashboard URL (https://app.rutaapi.com), the marketing site (https://rutaapi.com), or a direct endpoint such as https://api.rutaapi.com/v1/chat/completions as the Base URL. The Base URL should be the API root (ending in /v1), not a specific endpoint path.
Disclaimer RutaAPI is an OpenAI-compatible API gateway. It is not an official OpenAI, Anthropic, Google or Microsoft service. Model availability depends on your account configuration and upstream providers. Always verify model availability with /v1/models before use.
How to start with RutaAPI
Step 1: Create a RutaAPI account
Register at app.rutaapi.com. No credit card is required to sign up.
Step 2: Add prepaid credits
Purchase a credit pack from the billing section. Credits are added immediately after payment.
Step 3: Create an API key
Go to the Tokens section and create a new key. Copy it right away — it is shown only once.
Step 4: Verify the endpoint with /v1/models
Before sending any request, confirm that your account has active models:
Use one of the model names returned by /v1/models as MODEL_NAME in the next step.
curl https://api.rutaapi.com/v1/models \
-H "Authorization: Bearer YOUR_RUTAAPI_KEY"Step 5: Send your first request
With a model selected, make your first call:
curl https://api.rutaapi.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_RUTAAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_NAME",
"messages": [
{"role": "user", "content": "Hello from RutaAPI"}
]
}'Security: Never share screenshots that show your full API key. Store the key in environment variables and rotate it immediately if exposed.
Who this guide is for
This guide is for developers and AI users who want to configure Claude Code, Codex CLI, Cursor or similar AI coding tools to use an OpenAI-compatible Base URL provided by RutaAPI.
It helps if you are familiar with environment variables, API keys, and making HTTP requests from a terminal.
Who should not use this setup
- Users who only need a single AI coding tool with no custom endpoint configuration.
- Users who require a direct contract with a specific model provider.
- Users whose tool does not support custom API endpoints or environment-variable configuration.
Claude Code setup notes
Some Claude Code workflows can use custom gateway routing through environment variables or compatible proxy settings. The exact configuration keys vary by Claude Code version and plan.
Always test with /v1/models and a small request first before running any coding tasks.
Refer to the Claude Code setup guide for the full configuration steps.
Codex CLI setup notes
Codex supports custom model providers through configuration that can include a provider name, base URL, wire API and authentication environment key.
The exact config keys can vary by Codex version, so use the RutaAPI Codex CLI docs alongside the current Codex documentation.
Cursor setup notes
Cursor custom API support can vary by version and plan. Check Cursor settings and verify the Base URL, API key and model list before production use.
If RutaAPI does not yet have a dedicated Cursor docs page, refer to RutaAPI Docs and this page for the Base URL and API key setup.
Do not assume all Cursor versions support the same custom API configuration options.
How to pick a model name
Model names are returned by the GET /v1/models endpoint. Copy one of the model id values from the response and use it as the model field in your request.
Model availability is per-account. If a model name is not in your /v1/models response, it is not active in your account — add more credits or contact support.
Common errors
401 Unauthorized
The API key is missing, incorrect, or has been revoked. Check that the Bearer token in the Authorization header matches your current RutaAPI key exactly. Keys are shown only once at creation — if you lost yours, create a new one from the dashboard.
403 Forbidden
The key exists but lacks permission for the requested model or endpoint. Verify that your account has sufficient prepaid credits and that the model is enabled for your account tier.
404 Not Found / Model not found
The model name does not exist in your account. Run GET /v1/models and use a model ID from that list. Model names differ between providers — do not assume a name works without checking first.
429 Too Many Requests
You have hit a rate limit. Check your credit balance — if credits are exhausted, requests are rejected. If credits are fine, you may be sending too many concurrent requests. Slow down and retry after a short pause.
503 Service Unavailable
The upstream model provider is temporarily unreachable. This is not a RutaAPI configuration issue. Check the dashboard for provider status and retry once the service recovers.
When RutaAPI may be a good fit
- You want one OpenAI-compatible Base URL for multiple AI coding tools.
- You want prepaid AI API credits instead of a monthly contract.
- You need API key creation and management from a dashboard.
- You want practical docs for Codex CLI and Claude Code setup.
- You want usage visibility — requests, models, credits remaining.
- You want to test models before a deeper integration.
When RutaAPI may not be the right fit
- You need official provider-only enterprise features or direct contracts.
- You require guaranteed availability of one exact model with no routing.
- Your tool does not support custom API endpoints.
- You do not want an API gateway layer.
Related setup guides
- Codex CLI setup with RutaAPI
- Claude Code setup with RutaAPI
- All RutaAPI Docs
- Available models
- Pricing and credit packs
FAQ
Can Claude Code, Codex CLI and Cursor use the same Base URL?
When they support custom endpoint configuration, yes — if all three point to the same OpenAI-compatible Base URL (https://api.rutaapi.com/v1) with their own API keys, they can share the same gateway. Each tool may still need its own environment variable or config file format.
What is the RutaAPI Base URL?
The Base URL is https://api.rutaapi.com/v1. Always include /v1. Do not use the dashboard URL, the marketing site, or a specific endpoint path.
Should the Base URL include /v1?
Yes. The /v1 path is the OpenAI-compatible API root. Omitting it means you are pointing to the wrong endpoint and will get 404 errors.
Should I paste the dashboard URL as the Base URL?
No. The dashboard URL (app.rutaapi.com) is for account management. It is not the API root. Using it as the Base URL will result in errors.
How do I know which model name to use?
Call GET /v1/models with your API key. Use one of the model id values from the response as the model field in your request. If a model is not in the list, it is not active in your account.
What does a 401 error mean?
A 401 means the API key is missing, incorrect, or has been revoked. Verify the Bearer token matches your current RutaAPI key. If you lost the key, create a new one from the dashboard.
What does a 403 error mean?
A 403 means the key lacks permission for the requested model or endpoint. Check that your account has enough prepaid credits and that the model is enabled for your account.
What does a 404 model not found error mean?
The model name does not exist in your account. Run GET /v1/models and pick a model ID from that list. Do not guess the model name — model identifiers differ between providers.
What does a 429 error mean?
A 429 means you have hit a rate limit. If you have exhausted credits, requests will be rejected. If credits are fine, you may be sending too many concurrent requests. Slow down and retry.
Is RutaAPI an official OpenAI, Anthropic, Google or Microsoft service?
No. RutaAPI is an OpenAI-compatible API gateway operated by BDR FIDUCIARY LLC. It is not an official service of OpenAI, Anthropic, Google or Microsoft.
Can RutaAPI guarantee every model is always available?
No. Model availability depends on upstream providers and your account configuration. Always check /v1/models to see which models are currently active for your account.
How do I protect my API key?
Store the key in environment variables, never in source code or shared prompts. Rotate it immediately if exposed. You can create and revoke keys from the RutaAPI dashboard at any time.