DEVELOPER DOCUMENTATION
Connect to ModelPorta
Create an account, verify your email, add funds, and create an API key in your console. Live requests become available after service activation.
Base URL
https://modelporta.com/v1
Send a text request
curl https://modelporta.com/v1/chat/completions \
-H "Authorization: Bearer $MODELPORTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"MODEL_ID","messages":[{"role":"user","content":"Hello"}],"max_tokens":256}'Replace MODEL_ID with an enabled model from your console. Never place your secret key in browser code, public repositories, or support messages.
Supported endpoints
| GET /v1/models | List enabled models. API key required. |
| POST /v1/chat/completions | Text chat and client function tools using OpenAI-compatible JSON. |
| POST /v1/messages | Claude Messages format, text, client tools and prompt caching. |
Supported request fields
Chat Completions accepts model, messages, max_tokens or max_completion_tokens, temperature, top_p, stop, stream, stream_options.include_usage, client function tools, tool_choice, parallel_tool_calls, response_format and reasoning_effort. Messages accept text plus assistant tool calls and tool results. The selected model must support the requested options.
Set stream: true for live server-sent events. Content arrives as the provider generates it. Billing completes when the final usage and completion marker arrive. A stream error or disconnect without verified completion leaves the request held for review. Client tools run in your application; ModelPorta does not execute them. Images, audio, hosted tools, native Gemini endpoints and a public Responses endpoint are not enabled in this release. Supported Responses-only models are routed internally from Chat Completions.
Claude Messages
Send POST /v1/messages with your ModelPorta key in x-api-key or Authorization: Bearer. Use user/assistant messages, a top-level system field, max_tokens and optional stream. Supported content blocks include text, tool_use, tool_result and returned thinking blocks. Client tools use name and input_schema. Prompt caching supports ephemeral cache_control with 5m or 1h TTL, where available for the selected model.
Native Message streaming includes message_start, content block events, message_delta and message_stop. This is a limited compatibility surface; provider availability and live interoperability still need verification before launch.
Thinking controls, by model
Open “Prices & capabilities” in the catalog to see the exact model’s controls. GET /v1/models also returns capabilities for enabled models. An omitted thinking setting keeps the provider’s default; ModelPorta does not silently change the effort you request.
| Control | Request field |
|---|---|
| Supported OpenAI and Gemini effort levels | reasoning_effort |
| Claude effort, where supported | output_config.effort on /v1/messages |
| Claude manual thinking | thinking.type: enabled plus budget_tokens |
| Claude adaptive thinking | thinking.type: adaptive, without budget_tokens |
| Supported Qwen thinking | enable_thinking: true with stream: true |
| Supported GLM thinking | thinking.type: enabled or disabled |
Supported effort levels are specific to each model. “ultra” is not accepted. Some models support no explicit thinking controls; omit these fields to use their default behavior. Selected OpenAI models use an internal Responses adapter while your application keeps the Chat Completions format. Services with unimplemented billing remain unavailable.
OpenAI-compatible example
{
"model": "gpt-5.6-sol",
"messages": [
{
"role": "user",
"content": "Explain the trade-offs of this approach."
}
],
"reasoning_effort": "medium",
"max_completion_tokens": 2048
}For reasoning models, the output limit includes thinking tokens. ModelPorta translates max_tokens to max_completion_tokens for the OpenAI models requiring that field. Temperature and top_p must be omitted when incompatible with the model or selected effort.
Claude adaptive example
{
"model": "claude-opus-5",
"messages": [
{
"role": "user",
"content": "Compare these two approaches."
}
],
"thinking": {
"type": "adaptive"
},
"output_config": {
"effort": "medium"
},
"max_tokens": 4096
}Send this to /v1/messages. Older Claude models use manual thinking: budget_tokens must be at least 1024 and less than max_tokens. Newer adaptive-only models reject manual budgets. Claude Fable does not accept disabled thinking. Use only the modes listed for the exact model.
Gemini 2.5 budgets
{
"extra_body": {
"google": {
"thinking_config": {
"thinkingBudget": 1024,
"include_thoughts": true
}
}
}
}Add this object to a Gemini 2.5 chat request with a larger output limit. Choose a budget OR reasoning_effort, never both. A budget of -1 lets the model choose; 0 disables thinking only on models that permit it. The gateway validates each model’s limits.
Only the listed extra_body fields are permitted. Conflicting controls, unsupported levels and incompatible settings return 400 before any balance reservation or supplier call. A successful supplier request confirms acceptance, not that a particular depth of thinking was applied. Live routing and service-group checks are separate from documentation review.
Balances and limits
Input, output, cache reads and cache writes use their displayed USD rates per million tokens. Thinking tokens already included in output usage are not charged a second time. Native Claude cache usage is counted separately from uncached input. Requests are rounded up to the nearest 0.000001 USD. Context tiers may change prices for larger requests; review each model's price details.
Before a request, the maximum input budget plus your selected output limit is reserved, including the highest configured cache and context-tier rates. A conservative text-size check applies. The unused amount is released after successful billing. Up to three unsettled requests are allowed per account; each key allows 300 attempts per 15-minute window. Across all accounts and models, the API allows up to 300 unsettled requests at once. Requests held for billing review also occupy a slot until resolved. When capacity is full, new requests return 503 without reserving funds or contacting the provider. They are not queued; retry later with backoff. This configured limit is not a guaranteed throughput level.
If the provider's response or usage cannot be verified, funds remain on hold for support review. This also covers interrupted requests. Use the request ID when contacting support.
Error codes
| 400 | Check request fields and size. |
| 401 | Check your API key and verify your account email. |
| 402 | Add funds, check key budget, or wait for pending requests. |
| 404 | Choose an available model. |
| 429 | Wait before retrying. |
| 502 | Provider error; review the returned request ID before retrying. |
| 503 | Service is not enabled or temporarily unavailable. |
Non-thinking service routes
Models labelled “Non-thinking mode only” answer without a separate reasoning phase. ModelPorta automatically sends enable_thinking=false on those routes. Requests that enable thinking are rejected before funds are reserved. Pricing uses the published non-thinking tiers; reasoning usage or a changed route configuration is held for verification.
Provider route verification
Imported models must use a provider key assigned to their priced service group. On each successful provider response, ModelPorta checks the reported routing group before returning content or settling usage. A missing or unverified group pauses that model, clears its access verification, and holds the request for billing review. An inner relay alias is accepted only when its account charges were reconciled against the exact model, key, prices and limits. This check happens after the provider receives the request, so it cannot prevent a possible upstream charge. Fixed routing must be configured in the provider account before activation.
Model availability and preview prices
The catalog lists imported provider model identifiers and preview sale prices. Listed models are not automatically enabled. Price groups must match the upstream account configuration and pass access checks before activation. Rates are a dated snapshot, not an automatic price feed. Non-token services show reference prices and remain unavailable until their billing and endpoint support are implemented.
Explore models and pricesFund your account
Create an invoice for at least 10 USDT. Send the exact six-decimal amount using TRON (TRC20), then submit your transaction ID. Your full verified payment becomes API credit. Keep withdrawal fees separate. Do not transfer to expired invoices.
Payments are checked against finalized network records, the official USDT contract, the receiving address, the exact amount, and the invoice time. A transaction cannot be credited twice.
Open developer console