GET
/
v1
/
models
cURL
curl --request GET \
  --url https://nano-gpt.com/api/v1/models \
  --header 'Authorization: Bearer <token>'
{
  "object": "list",
  "data": [
    {
      "id": "chatgpt-4o-latest",
      "object": "model",
      "created": 123,
      "owned_by": "openai",
      "name": "GPT-4o Mini",
      "description": "OpenAI's affordable and intelligent small model for fast, lightweight tasks",
      "context_length": 128000,
      "pricing": {
        "prompt": 0.00015,
        "completion": 0.0006,
        "currency": "USD",
        "unit": "per_million_tokens"
      }
    }
  ]
}

Overview

The /api/v1/models endpoint provides a list of available text generation models. It supports optional detailed information including pricing data. The endpoint maintains full backwards compatibility while adding powerful new features. For embedding models, use the dedicated /api/v1/embedding-models endpoint which provides comprehensive information about all available embedding models.

Compatibility

Responses mirror OpenAI’s Models API shape. All models endpoints return:
{
  "object": "list",
  "data": [ { /* model */ }, ... ]
}
Each model minimally includes:
{
  "id": "deepseek/deepseek-chat-v3-0324",
  "object": "model",
  "created": 1736966400,
  "owned_by": "deepseek"
}

Features

  • Basic Mode: Standard OpenAI-compatible model listing
  • Detailed Mode: Enhanced information with pricing and model descriptions

Query Parameters

ParameterTypeDefaultDescription
detailedbooleanfalseReturns detailed model information including pricing and capabilities
When detailed=true, additional human-friendly fields may be included per model:
  • name — display name
  • description — short model description
  • context_length — max input tokens (if known)
  • capabilities.vision — whether the model supports native image input
  • pricing.prompt and pricing.completion — at-cost per-million-token pricing in USD
  • pricing.unitper_million_tokens
  • icon_url — small icon representing the provider
  • cost_estimate — internal rollup used in UI for cost hints

Authentication

Authentication is optional but enables user-specific pricing in detailed mode:
HeaderFormatRequiredDescription
AuthorizationBearer {api_key}OptionalAPI key for user-specific pricing
x-api-key{api_key}OptionalAlternative API key header
Notes:
  • Invalid or missing API keys still return a list of models. We simply omit user-specific pricing considerations in detailed=true mode.
  • With a valid key, the canonical /api/v1/models may apply your account’s subscription visibility preference (see Endpoint Variants).

Response Formats

Basic Response (Default)

Standard OpenAI-compatible format without pricing information:
{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o-mini",
      "object": "model",
      "created": 1704067200,
      "owned_by": "openai"
    },
    {
      "id": "claude-3-5-sonnet-20241022",
      "object": "model", 
      "created": 1704067200,
      "owned_by": "anthropic"
    }
  ]
}

Detailed Response

Enhanced format with model descriptions, context lengths, and pricing:
{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o-mini",
      "object": "model",
      "created": 1704067200,
      "owned_by": "openai",
      "name": "GPT-4o Mini",
      "description": "OpenAI's affordable and intelligent small model for fast, lightweight tasks",
      "context_length": 128000,
      "capabilities": { "vision": true },
      "pricing": {
        "prompt": 0.00015,
        "completion": 0.0006,
        "currency": "USD",
        "unit": "per_million_tokens"
      },
      "icon_url": "/icons/OpenAI.svg",
      "cost_estimate": { "cheap": true }
    },
    {
      "id": "claude-3-5-sonnet-20241022",
      "object": "model",
      "created": 1704067200,
      "owned_by": "anthropic",
      "name": "Claude 3.5 Sonnet",
      "description": "Anthropic's most intelligent model, combining top-tier performance with improved speed",
      "context_length": 200000,
      "capabilities": { "vision": false },
      "pricing": {
        "prompt": 0.003,
        "completion": 0.015,
        "currency": "USD", 
        "unit": "per_million_tokens"
      },
      "icon_url": "/icons/Anthropic.svg"
    }
  ]
}

Field Descriptions

Basic Fields (Always Present)

FieldTypeDescription
idstringUnique model identifier
objectstringAlways “model” for OpenAI compatibility
creatednumberUnix timestamp of response creation
owned_bystringModel provider (openai, anthropic, meta, google, etc.)

Enhanced Fields (Detailed Mode Only)

FieldTypeDescription
namestringHuman-readable model name
descriptionstringDetailed model description
context_lengthnumberMaximum input tokens (null if not available)
capabilitiesobjectFeature flags (e.g., vision: boolean)
pricingobjectPricing information object
icon_urlstringPath/URL for a small provider icon
cost_estimateobjectInternal hints (e.g., { cheap: true })

Pricing Object Structure

FieldTypeDescription
promptnumberCost per million input tokens in USD
completionnumberCost per million output tokens in USD
currencystringAlways “USD”
unitstringAlways “per_million_tokens”

Usage Examples

Basic Request

curl "https://nano-gpt.com/api/v1/models"

Detailed Request

curl "https://nano-gpt.com/api/v1/models?detailed=true"

Detailed with Authentication

curl "https://nano-gpt.com/api/v1/models?detailed=true" \
  -H "Authorization: Bearer your_api_key_here"

Alternative API Key Header

curl "https://nano-gpt.com/api/v1/models?detailed=true" \
  -H "x-api-key: your_api_key_here"

Endpoint Variants

In addition to the canonical /api/v1/models, two filtered variants are available:

1) GET /api/v1/models (canonical)

  • Returns all visible text models (excludes internal free/helper selector models except auto-model*).
  • If your account has an active subscription and you have not enabled “Also show paid models”, the list is automatically restricted to only subscription-included models.
  • If you enable “Also show paid models” in settings, it returns the full set again.
Examples:
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  https://nano-gpt.com/api/v1/models
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  "https://nano-gpt.com/api/v1/models?detailed=true"

2) GET /api/subscription/v1/models (subscription-only)

  • Always returns only models included in the NanoGPT subscription (equivalent to our isTextEligible(modelId) filter).
  • Ignores the user’s “Also show paid models” preference; it is always subscription-only.
  • Supports ?detailed=true and API key–aware, at-cost pricing metadata.
Examples:
curl https://nano-gpt.com/api/subscription/v1/models
curl -H "x-api-key: $NANOGPT_API_KEY" \
  "https://nano-gpt.com/api/subscription/v1/models?detailed=true"

3) GET /api/paid/v1/models (paid/extras)

  • Returns only models that are NOT part of the subscription (paid/premium/extras).
  • Supports ?detailed=true and API key–aware, at-cost pricing metadata.
Examples:
curl https://nano-gpt.com/api/paid/v1/models
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  "https://nano-gpt.com/api/paid/v1/models?detailed=true"

Choosing the Right Endpoint

  • Use /api/subscription/v1/models for curated lists guaranteed to be subscription-included (e.g., sub-only integrations).
  • Use /api/paid/v1/models to focus on paid or premium models.
  • Use /api/v1/models for the canonical list and let the account’s “Also show paid models” preference decide visibility.

Errors and Limits

  • These endpoints typically return 200 with a list. If an invalid API key is provided, the list still returns and simply omits user-specific pricing considerations in detailed=true mode.
  • Standard CORS and rate limiting apply. In overload scenarios you may receive 429 with:
{ "code": "rate_limited", "message": "Rate limit exceeded" }

Backwards Compatibility

  • Default response format unchanged
  • All existing fields preserved
  • New fields are additive only
  • No breaking changes to existing integrations
  • /api/v1/embedding-models - List all available embedding models with detailed information
  • /api/v1/embeddings - Create embeddings using the available models
  • /api/subscription/v1/models - Subscription-included text models
  • /api/paid/v1/models - Paid or premium text models

Notes

  • Scope: These endpoints list text-chat models. Image models used in the UI are covered by separate routes and/or the non-OpenAI UI endpoint GET /api/models.
  • Fields are subject to change as new capabilities or providers are added. We aim to remain OpenAI-API compatible for basic consumers (id/object/created/owned_by).

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

detailed
boolean
default:false

Returns detailed model information including pricing

Response

List of available models

object
string
default:list

Type of object, always 'list' for the models response

data
object[]

List of available models