Connection guide
Set the endpoint, API key, and model name to get started.
OpenAI format / Codex
https://api.ai.portomo.com/v1Include /v1 in the Base URL.
Anthropic format / Claude Code
https://api.ai.portomo.comDo not append /v1 to the Base URL.
Cursor
https://api.ai.portomo.com/v1Include /v1 in the Base URL.
Ready-to-use connection examples
YOUR_API_KEY should be replaced with your issued key.
export AIGATEWAY_API_KEY="YOUR_API_KEY"
curl https://api.ai.portomo.com/v1/chat/completions \
-H "Authorization: Bearer $AIGATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 256
}'import os
import requests
response = requests.post(
"https://api.ai.portomo.com/v1/responses",
headers={"Authorization": f"Bearer {os.environ['AIGATEWAY_API_KEY']}"},
json={"model": "deepseek-v4.1-flash", "input": "Hello", "max_output_tokens": 256},
timeout=120,
)
response.raise_for_status()
print(response.json())Before running, set the environment variable AIGATEWAY_API_KEY to your API key.
export AIGATEWAY_API_KEY="YOUR_API_KEY"
curl https://api.ai.portomo.com/v1/messages \
-H "x-api-key: $AIGATEWAY_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello"}]
}'$env:ANTHROPIC_BASE_URL = "https://api.ai.portomo.com"
$env:ANTHROPIC_API_KEY = "YOUR_API_KEY"
$env:ANTHROPIC_MODEL = "deepseek-v4.1-flash"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "deepseek-v4.1-flash"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "deepseek-v4.1-flash"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "deepseek-v4.1-flash"
claudeStart in interactive mode the first time and follow the API key confirmation prompts. Tool support varies by model.
model = "deepseek-v4.1-flash"
model_provider = "aigateway"
[model_providers.aigateway]
name = "AIGateway"
base_url = "https://api.ai.portomo.com/v1"
env_key = "AIGATEWAY_API_KEY"
wire_api = "responses"$env:AIGATEWAY_API_KEY = "YOUR_API_KEY"
codexAdd or update the relevant entries without duplicating names in your existing configuration file.Official provider configuration
Cursor
Use AIGateway models in Cursor with a custom API key and OpenAI-compatible endpoint. Top up your balance and create an API key first.
- Open Cursor Settings → Models. Under API Keys, enter your AIGateway key in OpenAI API Key, then save and enable it.
- Enable Override OpenAI Base URL and enter the URL below, including the final /v1.Base URL
https://api.ai.portomo.com/v1 - Use Add Custom Model to add and enable the model ID below. Change it using the model selector above.Model ID
deepseek-v4.1-flash - Select the added model in a new chat and send a short message. For Agent, choose a model that supports tool calls.
Settings and availability vary by Cursor version and plan. This method requires Override OpenAI Base URL. Features using Cursor's own models, such as Tab completion, are not included.
AIGateway API usage is deducted from your balance. Cursor's fees and terms apply separately. API keys and requests pass through Cursor's servers.
To restore your previous connection, disable the custom API key and Base URL override, then select your previous model. Record your existing settings before changing them.
Decision models (API only)
These return probabilities, choices, or scores from input and questions. They are not listed in client model pickers. Use the API shown for each model below.
/v1/decisions
gpt-6-luna-decisions support text and images, but not streaming.
export AIGATEWAY_API_KEY="YOUR_API_KEY"
curl https://api.ai.portomo.com/v1/decisions \
-H "Authorization: Bearer $AIGATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-luna-decisions",
"input": "All tests passed; a security review is still pending.",
"questions": [
{"type": "predicate", "name": "ready", "instructions": "Is this change ready to deploy without further review?"}
]
}'Provide questions as an array, using types predicate・choice・score. For images, use messages in input with input_image and a Base64 data URL. Up to 32 questions and a 4 MiB body are allowed. Do not send these to the standard Chat Completions or Responses API.
/v1/systemone
clef・clef-flash・jev-latest require a state (state) and a questions object.
export AIGATEWAY_API_KEY="YOUR_API_KEY"
curl https://api.ai.portomo.com/v1/systemone \
-H "Authorization: Bearer $AIGATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "clef",
"state": "All tests passed; a security review is still pending.",
"questions": {
"ready": {"type": "noul", "instructions": "Is this change ready to deploy without further review?"},
"next": {"type": "choice", "instructions": "What should happen next?",
"criteria": {"deploy": "Deploy now", "review": "Wait for the security review"}},
"risk": {"type": "score", "instructions": "How risky is deploying now?", "criteria": ["low", "medium", "high"]}
}
}'Question types are noul(yes/no probability), choice(choice), and score(a score on a 2–10 level scale). Each request allows up to 32 questions and a 262,144-byte body.
Probabilities are guidance for decisions and must not be treated as permission to execute actions. usage.cost is the amount deducted from your balance (USD).
Setup guides by tool
AIGateway works with tools that accept an OpenAI-compatible endpoint.
Troubleshooting
For 401 or 403, check your API key and balance. For 404, check the endpoint and API path. Use the model ID shown in Models & pricing. Never embed your API key in browser JavaScript.