Skip to main content
GET
/
v1
/
models
List Models
curl --request GET \
  --url https://api.gravitex.ai/v1/models

Documentation Index

Fetch the complete documentation index at: https://docs.gravitex.ai/llms.txt

Use this file to discover all available pages before exploring further.

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

Request signatureResponse format
x-api-key + anthropic-version headersAnthropic
x-goog-api-key header or ?key=xxx query paramGemini
Authorization: Bearer ... (default)OpenAI
When multiple credentials are present, the priority is: Anthropic > Gemini > OpenAI.

Authentication

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

Request Examples

curl https://api.gravitex.ai/v1/models \
  -H "Authorization: Bearer sk-XyLy**************************mIqSt"

Response Examples

{
  "object": "list",
  "data": [
    {
      "id": "gpt-5.4",
      "object": "model",
      "created": 1715232000,
      "owned_by": "openai"
    },
    {
      "id": "claude-sonnet-4-5-20250929",
      "object": "model",
      "created": 1743465600,
      "owned_by": "anthropic"
    },
    {
      "id": "gemini-2.5-pro",
      "object": "model",
      "created": 1746057600,
      "owned_by": "google"
    }
  ]
}

Response Fields

OpenAI format

FieldTypeDescription
objectstringAlways list
dataarrayModel list
data[].idstringModel identifier; use this as the model parameter in requests
data[].objectstringAlways model
data[].createdintegerRelease timestamp (Unix seconds)
data[].owned_bystringProvider, e.g. openai, anthropic, google

Anthropic format

FieldTypeDescription
dataarrayModel list
data[].typestringAlways model
data[].idstringModel identifier
data[].display_namestringHuman-friendly name
data[].created_atstringRelease time (ISO 8601 string)
has_morebooleanWhether more pages exist
first_id / last_idstringPagination cursors

Gemini format

FieldTypeDescription
modelsarrayModel list
models[].namestringResource name, format models/{id}
models[].displayNamestringHuman-friendly name
models[].descriptionstringModel description
models[].inputTokenLimitintegerMaximum input tokens
models[].outputTokenLimitintegerMaximum output tokens
models[].supportedGenerationMethodsarrayMethods supported by this model

Error Handling

StatusMeaningSuggested action
200Success
401API key invalid or expiredVerify the key; ensure it has not been disabled
429Too many requestsBack off and retry; contact BD to raise your quota
500Internal server errorRetry briefly; contact support if it persists
Error response example (OpenAI format):
{
  "error": {
    "message": "Invalid API key",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}

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