List Models
API documentation
List Models
Retrieve the list of models available to your API key, returned in OpenAI, Anthropic, or Gemini format.
GET
List Models
Introduction
Retrieve all models available to your API key. The same endpointhttps://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-xxxxxxxxxxstring
Anthropic authentication — the raw API key (no
Bearer prefix)string
Anthropic API version, e.g.
2023-06-01string
Gemini authentication — the raw API key
Request Examples
- OpenAI format
- Anthropic format
- Gemini format
Response Examples
- OpenAI format
- Anthropic format
- Gemini format
Response Fields
OpenAI format
Anthropic format
Gemini format
Error Handling
Error response example (OpenAI format):
Best Practices
Python example dependencies:
- OpenAI format:
pip install openai - Anthropic format:
pip install anthropic - Gemini format:
pip install requests
