GET
/
v1
/
models
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 models. It supports optional detailed information including pricing data. The endpoint maintains full backwards compatibility while adding powerful new features.

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

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

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,
      "pricing": {
        "prompt": 0.00015,
        "completion": 0.0006,
        "currency": "USD",
        "unit": "per_million_tokens"
      }
    },
    {
      "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,
      "pricing": {
        "prompt": 0.003,
        "completion": 0.015,
        "currency": "USD", 
        "unit": "per_million_tokens"
      }
    }
  ]
}

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)
pricingobjectPricing information object

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"

Backwards Compatibility

  • Default response format unchanged
  • All existing fields preserved
  • New fields are additive only
  • No breaking changes to existing integrations

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

200
application/json

List of available models

The response is of type object.

GET
/
v1
/
models
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 models. It supports optional detailed information including pricing data. The endpoint maintains full backwards compatibility while adding powerful new features.

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

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

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,
      "pricing": {
        "prompt": 0.00015,
        "completion": 0.0006,
        "currency": "USD",
        "unit": "per_million_tokens"
      }
    },
    {
      "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,
      "pricing": {
        "prompt": 0.003,
        "completion": 0.015,
        "currency": "USD", 
        "unit": "per_million_tokens"
      }
    }
  ]
}

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)
pricingobjectPricing information object

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"

Backwards Compatibility

  • Default response format unchanged
  • All existing fields preserved
  • New fields are additive only
  • No breaking changes to existing integrations

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

200
application/json

List of available models

The response is of type object.