# OpenAI format

`GET /v1/models`

Returns the list of models currently available.

The response format is detected automatically from the request headers:
- `x-api-key` together with `anthropic-version` → Anthropic format
- the `x-goog-api-key` header or the `key` query parameter → Gemini format
- otherwise → OpenAI format

## Authorizations

Bearer authentication — send `Authorization: Bearer <token>`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `key` | query | string | no | Google API key (for the Gemini format) |
| `x-api-key` | header | string | no | Anthropic API key (for the Claude format) |
| `anthropic-version` | header | string | no | Anthropic API version |
| `x-goog-api-key` | header | string | no | Google API key (for the Gemini format) |

## Responses

### 200 — Model list returned

```json
{
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "example": "list"
    },
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Model ID",
            "example": "gpt-4"
          },
          "object": {
            "type": "string",
            "description": "Object type",
            "example": "model"
          },
          "created": {
            "type": "integer",
            "description": "Creation timestamp"
          },
          "owned_by": {
            "type": "string",
            "description": "Model owner",
            "example": "openai"
          }
        }
      }
    }
  }
}
```

### 401 — Authentication failed

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Error message"
        },
        "type": {
          "type": "string",
          "description": "Error type"
        },
        "param": {
          "type": "string",
          "description": "Related parameter",
          "nullable": true
        },
        "code": {
          "type": "string",
          "description": "Error code",
          "nullable": true
        }
      }
    }
  }
}
```
