Skip to main content

API Overview

The Models API is used to obtain the AI model list and detailed information supported by the Laozhang API platform. Through this interface, you can view all available models, understand model features, and pricing information.

API Information

API Endpoint: GET https://api.laozhang.ai/v1/models Compatibility: Fully compatible with OpenAI official API format

Get Model List

Request Examples

curl https://api.laozhang.ai/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Format

{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1687882411,
      "owned_by": "openai",
      "permission": [
        {
          "id": "modelperm-xxx",
          "object": "model_permission",
          "created": 1687882411,
          "allow_create_engine": false,
          "allow_sampling": true,
          "allow_logprobs": true,
          "allow_search_indices": false,
          "allow_view": true,
          "allow_fine_tuning": false,
          "organization": "*",
          "group": null,
          "is_blocking": false
        }
      ],
      "root": "gpt-4o",
      "parent": null
    },
    {
      "id": "gpt-4o-mini",
      "object": "model",
      "created": 1687882411,
      "owned_by": "openai",
      "permission": [...],
      "root": "gpt-4o-mini",
      "parent": null
    }
  ]
}

Get Specific Model Information

Request Examples

curl https://api.laozhang.ai/v1/models/gpt-4o \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Format

{
  "id": "gpt-4o",
  "object": "model",
  "created": 1687882411,
  "owned_by": "openai",
  "permission": [
    {
      "id": "modelperm-xxx",
      "object": "model_permission",
      "created": 1687882411,
      "allow_create_engine": false,
      "allow_sampling": true,
      "allow_logprobs": true,
      "allow_search_indices": false,
      "allow_view": true,
      "allow_fine_tuning": false,
      "organization": "*",
      "group": null,
      "is_blocking": false
    }
  ],
  "root": "gpt-4o",
  "parent": null
}

Response Field Descriptions

FieldTypeDescription
idstringUnique identifier for the model
objectstringObject type, fixed as “model”
createdintegerModel creation timestamp
owned_bystringModel owner
permissionarrayModel permission list
rootstringRoot model name
parentstringParent model name (if applicable)

Major Model Categories

OpenAI Series

Latest multimodal models supporting text, image, and audio processingAvailable Models:
  • gpt-4o - Latest flagship model
  • gpt-4o-mini - Lightweight and efficient version
  • gpt-4o-2024-11-20 - Specific date version
Features:
  • Supports image understanding and generation
  • Excellent multilingual capabilities
  • Powerful reasoning abilities
Classic GPT-4 model series providing powerful text generation capabilitiesAvailable Models:
  • gpt-4 - Standard GPT-4 model
  • gpt-4-turbo - Faster version
  • gpt-4-32k - Supports 32K context
Features:
  • Excellent text generation quality
  • Strong logical reasoning ability
  • Good code understanding capability
Models designed specifically for complex reasoning tasksAvailable Models:
  • o1-preview - Reasoning capability preview version
  • o1-mini - Lightweight reasoning model
  • o3 - Latest reasoning model
Features:
  • Powerful mathematical reasoning ability
  • Suitable for complex logical problems
  • Does not support streaming output

Claude Series

Anthropic’s latest high-performance modelsAvailable Models:
  • claude-3-5-sonnet-20241022 - Most powerful version
  • claude-3-5-haiku-20241022 - Fast version
Features:
  • Excellent code generation capability
  • Strong text understanding ability
  • Supports long text processing
Classic Claude 3 model seriesAvailable Models:
  • claude-3-opus-20240229 - Strongest reasoning capability
  • claude-3-sonnet-20240229 - Balanced version
  • claude-3-haiku-20240307 - Fast version
Features:
  • High security
  • Strong reasoning ability
  • Supports multiple task types

Google Gemini Series

Google’s latest multimodal modelsAvailable Models:
  • gemini-1.5-pro - High-performance version
  • gemini-1.5-flash - Fast version
Features:
  • Ultra-long context support (up to 2 million tokens)
  • Strong multimodal capabilities
  • Fast processing speed
Classic Gemini Pro modelsAvailable Models:
  • gemini-pro - Standard version
  • gemini-pro-vision - Supports image understanding
Features:
  • Good multilingual support
  • Powerful analytical capabilities
  • Suitable for enterprise applications

Chinese Language Models

Large language models developed by AlibabaAvailable Models:
  • qwen-turbo - Fast version
  • qwen-plus - High-performance version
  • qwen-max - Most powerful version
Features:
  • Outstanding Chinese capabilities
  • Rich multi-domain knowledge
  • High cost-performance ratio
Models focused on code and reasoningAvailable Models:
  • deepseek-chat - Dialogue model
  • deepseek-coder - Code-specific
  • deepseek-v2.5 - Latest version
Features:
  • Outstanding code capabilities
  • Strong reasoning ability
  • Open-source friendly
Large models developed by Tsinghua UniversityAvailable Models:
  • glm-4 - Fourth generation model
  • glm-4v - Multimodal version
  • glm-3-turbo - Fast version
Features:
  • Strong academic capabilities
  • Excellent Chinese-English bilingual
  • Suitable for research applications

Image Generation Models

Text-to-Image

Model IDProviderFeaturesPrice
dall-e-3OpenAIHigh-quality image generation$0.04/image
dall-e-2OpenAIClassic image generation$0.02/image
gpt-4o-imageLaozhang API optimizedUltra-high cost-performance$0.01/image
flux-proFluxProfessional-grade quality$0.05/image
flux-devFluxDevelopment version$0.03/image
midjourney-v6MidjourneyStrong artistic quality$0.08/image
stable-diffusion-xlStability AIOpen-source high-quality$0.02/image

Image Understanding

Model IDProviderFeaturesPrice
gpt-4oOpenAIStrong image understanding$5/1M tokens
gpt-4o-miniOpenAILightweight image understanding$0.15/1M tokens
gemini-pro-visionGoogleMultimodal understanding$0.25/1M tokens
claude-3-5-sonnetAnthropicDocument image understanding$3/1M tokens

Audio Models

Text-to-Speech (TTS)

Model IDProviderFeaturesPrice
tts-1OpenAIStandard speech synthesis$15/1M characters
tts-1-hdOpenAIHigh-definition speech synthesis$30/1M characters

Speech-to-Text (STT)

Model IDProviderFeaturesPrice
whisper-1OpenAIMultilingual speech recognition$0.006/minute

Usage Recommendations

Select Models by Scenario

Cost-Performance Selection

Recommended Models:
  • GPT-4o Mini: $0.15/1M tokens (input)
  • Claude 3.5 Haiku: $1/1M tokens (input)
  • Tongyi Qianwen Turbo: $0.3/1M tokens (input)
  • DeepSeek Chat: $0.14/1M tokens (input)
Suitable Scenarios:
  • Large-scale text processing
  • Batch data analysis
  • Development and testing phases
Recommended Models:
  • GPT-4o: $5/1M tokens (input)
  • Claude 3.5 Sonnet: $3/1M tokens (input)
  • O1 Preview: $15/1M tokens (input)
Suitable Scenarios:
  • Critical business applications
  • Complex reasoning tasks
  • High-quality content generation
Recommended Models:
  • GPT-4 Turbo: $10/1M tokens (input)
  • Claude 3 Sonnet: $3/1M tokens (input)
  • Gemini 1.5 Pro: $1.25/1M tokens (input)
Suitable Scenarios:
  • Daily business applications
  • Medium-complexity tasks
  • Long-term stable usage

Real-time Model Information Retrieval

You can obtain the latest model list and pricing information in real-time through the API:
import requests

# Get model list
response = requests.get(
    "https://api.laozhang.ai/v1/models",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

models = response.json()
for model in models['data']:
    print(f"Model: {model['id']}, Owner: {model['owned_by']}")

Error Handling

Error CodeDescriptionSolution
401Invalid API KeyCheck if API Key is correct
403Insufficient permissionsConfirm API Key has access permissions
404Model does not existCheck if model ID is correct
429Too many requestsReduce request frequency
500Server errorRetry later or contact support

I