Try a request
curl https://api.nativeport.ai/inference/v1/models \ -H "Authorization: Bearer $NATIVEPORT_API_KEY" # or one model, by id curl https://api.nativeport.ai/inference/v1/models/openai/gpt-5.4-mini \ -H "Authorization: Bearer $NATIVEPORT_API_KEY"
{
"object": "list",
"data": [
{
"id": "openai/gpt-5.4-mini",
"context_window": 400000,
"pricing": {"prompt_usd_per_1m": 0.25,
"completion_usd_per_1m": 2.00},
"capabilities": ["chat", "tools", "vision", "json_mode"]
},
{
"id": "anthropic/claude-sonnet-5",
"context_window": 200000,
"pricing": {"prompt_usd_per_1m": 3.00,
"completion_usd_per_1m": 15.00},
"capabilities": ["chat", "tools", "vision", "json_mode"]
}
]
}Estimate the cost of your workload
The catalog lists available models with their context windows, supported features, and input and output token prices. Start by keeping the models that meet your requirements, then estimate what each would cost for your expected traffic.
The Python example below compares a workload of two million input tokens and 300,000 output tokens. Change those values to match your app. It filters for tool support and sorts the remaining models by estimated cost.
A low price is useful only if the model produces answers you can use. Try your own prompts with the shortlisted models and compare the results before choosing. Our leaderboards can help with that research where we have measured the relevant capability.
Once you choose a model, use its ID in the chat-completions request. Model selection and fallback logic stay in your application; there is no separate routing configuration to set up.
Estimate monthly costs for models that support tools
Adjust the token counts to your expected traffic. This example reads the catalog without making inference requests.
import json, os, urllib.request
NEED = "tools" # capability the job requires
PROMPT_TOKENS = 2_000_000
OUT_TOKENS = 300_000
req = urllib.request.Request(
"https://api.nativeport.ai/inference/v1/models",
headers={"Authorization": f"Bearer {os.environ['NATIVEPORT_API_KEY']}"},
)
with urllib.request.urlopen(req) as r:
models = json.load(r)["data"]
def monthly(m):
p = m["pricing"]
return (PROMPT_TOKENS / 1e6 * p["prompt_usd_per_1m"]
+ OUT_TOKENS / 1e6 * p["completion_usd_per_1m"])
fit = [m for m in models if NEED in m.get("capabilities", [])]
fit.sort(key=monthly)
print(f"{'model':<34} {'ctx':>8} {'est. month':>10}")
for m in fit[:5]:
print(f"{m['id']:<34} {m['context_window']:>8} ${monthly(m):>9.2f}")$ python cheapest.py model ctx est. month openai/gpt-5.4-mini 400000 $ 1.10 huggingface/zai-org/GLM-5.2 128000 $ 1.84 anthropic/claude-sonnet-5 200000 $ 10.50
Use it with NativePort
Compare available models and try them with one NativePort key. Your shared balance covers the model you choose, so testing another provider does not require a new account.
Before you start
Are these the rates used for billing?
The catalog returns each model’s input and output token prices in USD. NativePort bills model usage at those rates with nothing added per call. The response shown here is an example; query the endpoint for current prices.
How do I use the model I choose?
Send its ID in the model field of a chat-completions request to /inference/v1/chat/completions. Your application decides which model to use and whether to try another if a request fails.
Can I find models that support tools or images?
Yes. Each catalog entry includes a capabilities list. Filter it for the features you need, then check the context window and compare the estimated cost.
When should I refresh the catalog?
Refresh it before a batch that depends on a particular model or price. If you cache the list, use a short lifetime so additions, removals, and price changes can reach your app.