Skip to main content
GET
List Models

Introduction

Retrieve all models available to your API key. The same endpoint https://api.gravitex.ai/v1/models automatically returns the response in the appropriate platform’s native format based on request headers — no need to switch URLs or maintain multiple integrations.

Auto Format Detection

GravitexAI inspects the auth headers to detect the client type and returns the response using the official OpenAI / Anthropic / Gemini ListModels schema, so native SDKs work out of the box.

Format Detection Rules

When multiple credentials are present, the priority is: Anthropic > Gemini > OpenAI.

Authentication

string
OpenAI-compatible authentication, format: Bearer sk-xxxxxxxxxx
string
Anthropic authentication — the raw API key (no Bearer prefix)
string
Anthropic API version, e.g. 2023-06-01
string
Gemini authentication — the raw API key

Request Examples

Response Examples

Response Fields

OpenAI format

Anthropic format

Gemini format

Error Handling

Error response example (OpenAI format):

Best Practices

  • Cache the result — the model list changes infrequently; caching for 1+ hour avoids unnecessary requests.
  • Validate at startup — call this endpoint once at boot to confirm the key works and the target model is available.
  • Permission-aware — the returned list varies with the API key’s entitlements; different keys may see different models.
  • Drop-in SDKs — when using the official OpenAI / Anthropic / Google SDKs, simply point the base URL to https://api.gravitex.ai; no extra adapters required.
Python example dependencies:
  • OpenAI format: pip install openai
  • Anthropic format: pip install anthropic
  • Gemini format: pip install requests