---
title: "List models (OpenAI format)"
description: "Lists the models your API key can call through the gateway, in OpenAI's model list format. Point an OpenAI-compatible client's model picker at it. On the gateway host an API key is required."
---

**GET** `https://gateway.respan.ai/v1/models`

Lists the models your API key can call through the gateway, in OpenAI's model list format. Point an OpenAI-compatible client's model picker at it. On the gateway host an API key is required.

## Servers

`https://gateway.respan.ai`: Respan gateway

## Authentication

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


## Examples

### List models

#### Headers


```json
{
  "Authorization": "Bearer YOUR_RESPAN_API_KEY"
}
```


#### Response


```json
{
  "body": {
    "object": "list",
    "data": [
      {
        "id": "gpt-4.1-nano",
        "object": "model",
        "created": 0,
        "owned_by": "openai"
      },
      {
        "id": "claude-haiku-4-5",
        "object": "model",
        "created": 0,
        "owned_by": "anthropic"
      }
    ]
  }
}
```


#### cURL


```bash
curl --request GET 'https://gateway.respan.ai/v1/models' \
  --header "Authorization: Bearer $RESPAN_API_KEY"
```


<details>
<summary>Python</summary>



```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://gateway.respan.ai/v1/models",
    headers={
        "Authorization": f"Bearer {os.environ['RESPAN_API_KEY']}",
    },
    method="GET",
)
with urllib.request.urlopen(request) as response:
    print(response.read().decode())
```


</details>

<details>
<summary>TypeScript</summary>



```typescript
const response = await fetch("https://gateway.respan.ai/v1/models", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.RESPAN_API_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```


</details>

## Responses

### 200

The model list.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Reference: `#/components/schemas/OpenAIModelList` |
| `object` | `string` | Required in parent | Allowed: `"list"`<br />Example: `"list"` |
| `data` | `array<object>` | Required in parent | - |
| `data[]` | `object` | Array item | Reference: `#/components/schemas/OpenAIModel` |
| `data[].id` | `string` | Required in parent | Model ID. Send it as `model` in gateway requests.<br />Example: `"gpt-4o-mini"` |
| `data[].object` | `string` | Required in parent | Allowed: `"model"`<br />Example: `"model"` |
| `data[].created` | `integer` | Required in parent | Release date as a Unix timestamp, or `0` if unknown.<br />Example: `1721260800` |
| `data[].owned_by` | `string` | Required in parent | The organization that develops the model.<br />Example: `"openai"` |
| `data[].context_length` | `integer or null` | Required in parent | Context window in tokens, or `null` if unknown.<br />Example: `128000` |
| `data[].pricing` | `object` | Required in parent | Prices in USD.<br />Reference: `#/components/schemas/OpenAIModelPricing` |
| `data[].pricing.input_cost` | `number or null` | Required in parent | Input price per `input_price_unit`, after the Respan discount and the time-of-day schedule in effect now. Token and character prices are per 1M.<br />Example: `0.15` |
| `data[].pricing.output_cost` | `number or null` | Required in parent | Output price per `output_price_unit`, after the Respan discount and the time-of-day schedule in effect now. Token and character prices are per 1M.<br />Example: `0.6` |
| `data[].pricing.input_price_unit` | `string` | Required in parent | Unit for `input_cost`.<br />Allowed: `"token"`, `"image"`, `"second"`, `"minute"`, `"hour"`, `"character"`<br />Example: `"token"` |
| `data[].pricing.output_price_unit` | `string` | Required in parent | Unit for `output_cost`.<br />Allowed: `"token"`, `"image"`, `"second"`, `"minute"`, `"hour"`, `"character"`<br />Example: `"token"` |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "$ref": "#/components/schemas/OpenAIModelList"
}
```

</details>

##### Example


```json
{
  "object": "list",
  "data": [
    {
      "id": "gpt-4.1-nano",
      "object": "model",
      "created": 0,
      "owned_by": "openai"
    },
    {
      "id": "claude-haiku-4-5",
      "object": "model",
      "created": 0,
      "owned_by": "anthropic"
    }
  ]
}
```


### 403

The API key is missing, invalid or expired.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | OpenAI-style error written by the gateway.<br />Reference: `#/components/schemas/GatewayError` |
| `error` | `object` | Required in parent | - |
| `error.message` | `string` | Required in parent | - |
| `error.type` | `string` | Optional | - |
| `error.param` | `string or null` | Optional | - |
| `error.code` | `string or null` | Optional | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "$ref": "#/components/schemas/GatewayError"
}
```

</details>

##### Example


```json
{
  "error": {
    "message": "Your API key is invalid or expired, please check your API key in the platform settings.",
    "type": "error",
    "param": null,
    "code": "error"
  }
}
```


## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "List models (OpenAI format)",
  "operationId": "listGatewayModels",
  "tags": [
    "Gateway"
  ],
  "description": "Lists the models your API key can call through the gateway, in OpenAI's model list format. Point an OpenAI-compatible client's model picker at it. On the gateway host an API key is required.",
  "servers": [
    {
      "url": "https://gateway.respan.ai",
      "description": "Respan gateway"
    }
  ],
  "security": [
    {
      "RespanApiKey": []
    }
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "The model list.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/OpenAIModelList"
          },
          "example": {
            "object": "list",
            "data": [
              {
                "id": "gpt-4.1-nano",
                "object": "model",
                "created": 0,
                "owned_by": "openai"
              },
              {
                "id": "claude-haiku-4-5",
                "object": "model",
                "created": 0,
                "owned_by": "anthropic"
              }
            ]
          }
        }
      }
    },
    "403": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/GatewayError"
          },
          "example": {
            "error": {
              "message": "Your API key is invalid or expired, please check your API key in the platform settings.",
              "type": "error",
              "param": null,
              "code": "error"
            }
          }
        }
      }
    }
  },
  "x-fern-examples": [
    {
      "name": "List models",
      "headers": {
        "Authorization": "Bearer YOUR_RESPAN_API_KEY"
      },
      "response": {
        "body": {
          "object": "list",
          "data": [
            {
              "id": "gpt-4.1-nano",
              "object": "model",
              "created": 0,
              "owned_by": "openai"
            },
            {
              "id": "claude-haiku-4-5",
              "object": "model",
              "created": 0,
              "owned_by": "anthropic"
            }
          ]
        }
      }
    }
  ]
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "schemas": {
    "GatewayError": {
      "type": "object",
      "required": [
        "error"
      ],
      "description": "OpenAI-style error written by the gateway.",
      "properties": {
        "error": {
          "type": "object",
          "required": [
            "message"
          ],
          "properties": {
            "message": {
              "type": "string"
            },
            "type": {
              "type": "string"
            },
            "param": {
              "type": "string",
              "nullable": true
            },
            "code": {
              "type": "string",
              "nullable": true
            }
          }
        }
      }
    },
    "OpenAIModel": {
      "type": "object",
      "required": [
        "id",
        "object",
        "created",
        "owned_by",
        "context_length",
        "pricing"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Model ID. Send it as `model` in gateway requests.",
          "example": "gpt-4o-mini"
        },
        "object": {
          "type": "string",
          "enum": [
            "model"
          ],
          "example": "model"
        },
        "created": {
          "type": "integer",
          "description": "Release date as a Unix timestamp, or `0` if unknown.",
          "example": 1721260800
        },
        "owned_by": {
          "type": "string",
          "description": "The organization that develops the model.",
          "example": "openai"
        },
        "context_length": {
          "type": "integer",
          "nullable": true,
          "description": "Context window in tokens, or `null` if unknown.",
          "example": 128000
        },
        "pricing": {
          "$ref": "#/components/schemas/OpenAIModelPricing"
        }
      }
    },
    "OpenAIModelList": {
      "type": "object",
      "required": [
        "object",
        "data"
      ],
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "list"
          ],
          "example": "list"
        },
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/OpenAIModel"
          }
        }
      }
    },
    "OpenAIModelPricing": {
      "type": "object",
      "description": "Prices in USD.",
      "required": [
        "input_cost",
        "output_cost",
        "input_price_unit",
        "output_price_unit"
      ],
      "properties": {
        "input_cost": {
          "type": "number",
          "nullable": true,
          "description": "Input price per `input_price_unit`, after the Respan discount and the time-of-day schedule in effect now. Token and character prices are per 1M.",
          "example": 0.15
        },
        "output_cost": {
          "type": "number",
          "nullable": true,
          "description": "Output price per `output_price_unit`, after the Respan discount and the time-of-day schedule in effect now. Token and character prices are per 1M.",
          "example": 0.6
        },
        "input_price_unit": {
          "type": "string",
          "enum": [
            "token",
            "image",
            "second",
            "minute",
            "hour",
            "character"
          ],
          "description": "Unit for `input_cost`.",
          "example": "token"
        },
        "output_price_unit": {
          "type": "string",
          "enum": [
            "token",
            "image",
            "second",
            "minute",
            "hour",
            "character"
          ],
          "description": "Unit for `output_cost`.",
          "example": "token"
        }
      }
    }
  },
  "securitySchemes": {
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
