> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nativeport.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nativeport.ai/_mcp/server.

# List every model your key can reach

GET https://api.nativeport.ai/inference/v1/models

Every canonical id across all four providers that this gateway supports — a model it
doesn't support is simply absent from this list, the same way the four native provider
routes filter their own local `GET /v1/models`. `GET /inference/v1/models` is the
authoritative list of model IDs supported by the gateway. Each entry carries its `capabilities`, the exact
`supported_parameters` this gateway accepts for it, and per-1M-token USD `pricing`.


Reference: https://docs.nativeport.ai/api-reference/api-reference/inference/list-models

## Authentication

- `Authorization` header (bearer token, required) — Your per-client bearer token — the API key the gateway issued to you. Present it in `Authorization: Bearer <token>` form. A token that is missing, unknown, or revoked draws a `401`. Before the call is sent upstream the token is removed (stripped, or swapped for the upstream's own credential); it never makes it past the gateway.

## Servers

- `https://api.nativeport.ai` (NativePort production, default)
- `http://localhost:8787` (Local development (wrangler dev))

## Response

### 200

The catalog of models supported by the gateway, OpenAI model-list-shaped.

- `object` ("list", optional)
- `data` (list of InferenceModel, optional)

## Errors

### 401 Unauthorized Error

The bearer token was missing, unknown, or revoked. The reply body is the JSON `{ "error": "Unauthorized." }`.

- `error` (string, required) — Explanatory message meant for humans.

### 402 Payment Required Error

Insufficient credits — either of two distinct checks, at two different layers, can produce this status: * **The account-wide credit gate**, shared by every route in this spec (see [Common responses](/api-reference)), rejects the call before it reaches `/inference` routing logic at all if the account balance is zero or negative. This one answers the gateway-wide plain `{"error": "..."}` shape, not the OpenAI-shaped envelope the rest of this endpoint uses. * **A per-request cost-estimate preflight**, inside whichever of the four provider pipelines the request resolved to, rejects a specific call whose estimated input cost alone would exceed the remaining balance. This one uses the OpenAI-shaped envelope, consistent with every other error this endpoint produces past the gate — though `code` is always `gateway_insufficient_credits`, the envelope's `type` string is whichever that resolved provider's own pipeline uses (`insufficient_credits` for OpenAI, `billing_error` for Anthropic, `invalid_request_error` for xAI and Hugging Face), not a single normalized value.

- `InferenceListModelsRequestPaymentRequiredError`
  - Error: Error
  - InferenceError: InferenceError

### 403 Forbidden Error

The bearer token is valid but the account is currently suspended (non-billing enforcement action, distinct from an empty balance).

- `error` (string, required) — Explanatory message meant for humans.

## Types

### InferenceModel

- `id` (string, optional) — The canonical model id (same form accepted in a chat request's `model` field).
- `object` ("model", optional)
- `created` (integer, optional)
- `owned_by` (string, optional) — For a Hugging Face entry, the underlying HF repo's owner segment — not necessarily the same string as `provider`.
- `provider` (enum, optional)
  - Allowed values: `openai`, `anthropic`, `xai`, `huggingface`
- `capabilities` (InferenceModelCapabilities, optional)
- `supported_parameters` (list of string, optional) — The optional `InferenceChatRequest` fields this gateway accepts — uniform across every listed model, since the common set is provider-agnostic by construction.
- `pricing` (InferenceModelPricing, optional) — Clean per-1M-token USD rates with the gateway's 5.5% fee included, sourced from the same price tables each native provider route bills from.

### Error

- `error` (string, required) — Explanatory message meant for humans.

### InferenceError

The OpenAI-shaped envelope every error this endpoint itself produces uses, regardless of which of the four providers a request resolved to.

- `error` (InferenceErrorError, required)

### InferenceModelCapabilities

- `streaming` (boolean, optional)
- `tools` (boolean, optional)
- `tool_choice` (boolean, optional)
- `vision` (boolean, optional) — Whether this specific model is known to accept `image_url` content parts — truthful per model, not a blanket value across the catalog.

### InferenceModelPricing

Clean per-1M-token USD rates with the gateway's 5.5% fee included, sourced from the same price tables each native provider route bills from.

- `currency` ("usd", optional)
- `input_per_million` (double, optional)
- `output_per_million` (double, optional)
- `cached_input_per_million` (double, optional) — OpenAI's cached-input discount rate, or Anthropic's cache-READ rate. Absent where the provider has no cache-read discount (xAI, Hugging Face).
- `cache_write_5m_per_million` (double, optional) — Anthropic only — writing a 5-minute ephemeral cache breakpoint.
- `cache_write_1h_per_million` (double, optional) — Anthropic only — writing a 1-hour ephemeral cache breakpoint.
- `cache_write_per_million` (double, optional) — OpenAI `gpt-5.6` family only — rate for the `cache_write_tokens` category OpenAI reports in `usage.input_tokens_details` (Responses API) or `usage.prompt_tokens_details` (Chat Completions API). A mutually exclusive input token category, never additive with `input_per_million` or `cached_input_per_million`.
- `long_context` (InferenceModelPricingLongContext, optional) — OpenAI `gpt-5.6` family only — present when the model has a distinct rate tier for requests whose input token count exceeds `threshold_input_tokens`. Absent for every other provider and model.

### InferenceErrorError

- `message` (string, required) — Explanatory message meant for humans.
- `type` (string, required) — An error category. The envelope shape is uniform, but for a gateway-originated error this string is whichever vocabulary the resolved provider's own pipeline uses (mostly OpenAI-style values like `invalid_request_error`/`rate_limit_error`, plus provider-specific ones like Anthropic's `billing_error` or OpenAI's own `insufficient_credits`) — it is not normalized to one fixed value across providers.
- `param` (string, required, nullable) — The offending request field, when the error names one.
- `code` (string, required, nullable) — A stable machine-readable reason. A `gateway_*` code is gateway-originated rather than passed through from a provider.

### InferenceModelPricingLongContext

OpenAI `gpt-5.6` family only — present when the model has a distinct rate tier for requests whose input token count exceeds `threshold_input_tokens`. Absent for every other provider and model.

- `threshold_input_tokens` (integer, optional) — Input token count above which these long-context rates replace the top-level (short-context) rates.
- `input_per_million` (double, optional)
- `cached_input_per_million` (double, optional)
- `cache_write_per_million` (double, optional)
- `output_per_million` (double, optional)

## Examples

**Response**

```json
{
  "object": "list",
  "data": [
    {
      "id": "openai/gpt-5.6-luna",
      "object": "model",
      "created": 1767225600,
      "owned_by": "openai",
      "provider": "openai",
      "capabilities": {
        "streaming": true,
        "tools": true,
        "tool_choice": true,
        "vision": true
      },
      "supported_parameters": [
        "max_tokens",
        "max_completion_tokens",
        "temperature",
        "top_p",
        "stop",
        "stream",
        "stream_options",
        "tools",
        "tool_choice",
        "parallel_tool_calls"
      ],
      "pricing": {
        "currency": "usd",
        "input_per_million": 0.211,
        "output_per_million": 1.266,
        "cached_input_per_million": 0.0211,
        "cache_write_per_million": 0.26375,
        "long_context": {
          "threshold_input_tokens": 272000,
          "input_per_million": 0.422,
          "cached_input_per_million": 0.0422,
          "cache_write_per_million": 0.5275,
          "output_per_million": 1.899
        }
      }
    },
    {
      "id": "anthropic/claude-sonnet-5",
      "object": "model",
      "created": 1767225600,
      "owned_by": "anthropic",
      "provider": "anthropic",
      "capabilities": {
        "streaming": true,
        "tools": true,
        "tool_choice": true,
        "vision": true
      },
      "supported_parameters": [
        "max_tokens",
        "max_completion_tokens",
        "temperature",
        "top_p",
        "stop",
        "stream",
        "stream_options",
        "tools",
        "tool_choice",
        "parallel_tool_calls"
      ],
      "pricing": {
        "currency": "usd",
        "input_per_million": 2.11,
        "output_per_million": 10.55,
        "cached_input_per_million": 0.211,
        "cache_write_5m_per_million": 2.6375,
        "cache_write_1h_per_million": 4.22
      }
    }
  ]
}
```

**SDK Code**

```python Catalog (truncated)
import requests

url = "https://api.nativeport.ai/inference/v1/models"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Catalog (truncated)
const url = 'https://api.nativeport.ai/inference/v1/models';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Catalog (truncated)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.nativeport.ai/inference/v1/models"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Catalog (truncated)
require 'uri'
require 'net/http'

url = URI("https://api.nativeport.ai/inference/v1/models")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Catalog (truncated)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.nativeport.ai/inference/v1/models")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Catalog (truncated)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.nativeport.ai/inference/v1/models', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Catalog (truncated)
using RestSharp;

var client = new RestClient("https://api.nativeport.ai/inference/v1/models");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Catalog (truncated)
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.nativeport.ai/inference/v1/models")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```