> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laozhang.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Models API | 200+ AI Models List | LaoZhang API

> Access 200+ AI models through unified API. GPT-4, Claude, Gemini, DeepSeek and more. OpenAI-compatible endpoint with real-time model information.

## 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://api2.laozhang.ai/v1/models`

**Compatibility**: Fully compatible with OpenAI official API format

## Get Model List

### Request Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api2.laozhang.ai/v1/models \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  import OpenAI from 'openai';

  const openai = new OpenAI({
    apiKey: 'YOUR_API_KEY',
    baseURL: 'https://api2.laozhang.ai/v1'
  });

  async function getModels() {
    const models = await openai.models.list();
    console.log(models);
  }

  getModels();
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="YOUR_API_KEY",
      base_url="https://api2.laozhang.ai/v1"
  )

  models = client.models.list()
  print(models)
  ```

  ```go Go theme={null}
  package main

  import (
      "context"
      "fmt"
      "github.com/sashabaranov/go-openai"
  )

  func main() {
      config := openai.DefaultConfig("YOUR_API_KEY")
      config.BaseURL = "https://api2.laozhang.ai/v1"
      
      client := openai.NewClientWithConfig(config)
      
      models, err := client.ListModels(context.Background())
      if err != nil {
          fmt.Printf("Error: %v\n", err)
          return
      }
      
      for _, model := range models.Models {
          fmt.Printf("Model: %s\n", model.ID)
      }
  }
  ```
</CodeGroup>

### Response Format

```json theme={null}
{
  "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

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api2.laozhang.ai/v1/models/gpt-4o \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const model = await openai.models.retrieve('gpt-4o');
  console.log(model);
  ```

  ```python Python theme={null}
  model = client.models.retrieve('gpt-4o')
  print(model)
  ```

  ```go Go theme={null}
  model, err := client.GetModel(context.Background(), "gpt-4o")
  if err != nil {
      fmt.Printf("Error: %v\n", err)
      return
  }
  fmt.Printf("Model: %+v\n", model)
  ```
</CodeGroup>

### Response Format

```json theme={null}
{
  "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

| Field        | Type    | Description                       |
| ------------ | ------- | --------------------------------- |
| `id`         | string  | Unique identifier for the model   |
| `object`     | string  | Object type, fixed as "model"     |
| `created`    | integer | Model creation timestamp          |
| `owned_by`   | string  | Model owner                       |
| `permission` | array   | Model permission list             |
| `root`       | string  | Root model name                   |
| `parent`     | string  | Parent model name (if applicable) |

## Major Model Categories

### OpenAI Series

<AccordionGroup>
  <Accordion icon="bot" title="GPT-5.5 Series">
    OpenAI's current flagship model family for complex reasoning, professional work, and code generation.

    **Available Models:**

    * `gpt-5.5` - Latest flagship model
    * `gpt-5.5-pro` - Higher-compute version for hard problems and long workflows

    **Features:**

    * Supports 1M context
    * Strong complex reasoning and coding-agent performance
    * Excellent multilingual capabilities
  </Accordion>

  <Accordion icon="bot" title="GPT-5 / GPT-4.1 Series">
    Stable general-purpose model families for production and cost-sensitive workloads.

    **Available Models:**

    * `gpt-5` - Advanced general tasks
    * `gpt-5-mini` - Lightweight and efficient version
    * `gpt-5-nano` - High-volume low-cost tasks
    * `gpt-4.1` - Classic stable model
    * `gpt-4.1-mini` - Fast, economical general-purpose choice

    **Features:**

    * Compatible with common OpenAI SDKs
    * Covers high-quality and low-cost needs
    * Good code understanding capability
  </Accordion>

  <Accordion icon="bot" title="Reasoning Models">
    Models designed specifically for complex reasoning tasks

    **Available Models:**

    * `o3-pro` - Top-tier reasoning tasks
    * `o3` - Complex reasoning, math, and programming
    * `o4-mini` - Lightweight reasoning and coding value

    **Features:**

    * Powerful mathematical reasoning ability
    * Suitable for complex logical problems
    * Choose model tier based on task complexity
  </Accordion>
</AccordionGroup>

### Claude Series

<AccordionGroup>
  <Accordion icon="bot" title="Claude 4.7 / 4.6 Series">
    Anthropic's current main model family for coding agents, complex reasoning, and long-text work.

    **Available Models:**

    * `claude-opus-4-7` - Current most capable general model
    * `claude-opus-4-7-thinking` - Deep reasoning mode
    * `claude-sonnet-4-6` - Balanced speed, cost, and intelligence
    * `claude-sonnet-4-6-thinking` - Sonnet reasoning mode
    * `claude-haiku-4-5` - Fast lightweight version

    **Features:**

    * Excellent code generation capability
    * Strong text understanding ability
    * Good fit for multi-step tool use and long workflows
  </Accordion>

  <Accordion icon="bot" title="Claude 4.5 / Legacy Compatibility">
    Classic high-performance versions for existing projects. New integrations should prefer Opus 4.7 or Sonnet 4.6.

    **Available Models:**

    * `claude-opus-4-5` - Classic high-performance version
    * `claude-sonnet-4-5` - Stable coding version
    * `claude-3-7-sonnet-latest` - Legacy compatibility
    * `claude-3-5-sonnet-latest` - Legacy compatibility

    **Features:**

    * Useful for smooth migration of existing configs
    * Not recommended as the first example for new docs
  </Accordion>
</AccordionGroup>

### Google Gemini Series

<AccordionGroup>
  <Accordion icon="globe" title="Gemini 3.1 / 3 Series">
    Google's latest Gemini series for multimodal, long-context, and tool-use workloads.

    **Available Models:**

    * `gemini-3.1-pro-preview` - Latest Pro preview model
    * `gemini-3.1-pro-preview-customtools` - Custom tools and bash workflows
    * `gemini-3-flash-preview` - Fast multimodal model
    * `gemini-3.1-flash-lite-preview` - Lightweight fast version
    * `gemini-3-pro-image-preview` - Image generation model

    **Features:**

    * Long-context and multimodal input
    * Strong multimodal capabilities
    * `gemini-3-pro-preview` has been shut down; migrate to `gemini-3.1-pro-preview`
  </Accordion>

  <Accordion icon="globe" title="Gemini 2.5 Series">
    Stable production-ready Gemini 2.5 models.

    **Available Models:**

    * `gemini-2.5-pro` - Stable long-context and multimodal model
    * `gemini-2.5-flash` - Fast response version
    * `gemini-2.5-flash-lite` - Lightweight version
    * `gemini-2.5-flash-image` - Image generation version

    **Features:**

    * Good fit for production and cost optimization
    * Complements Gemini 3 for stable vs. preview choices
  </Accordion>
</AccordionGroup>

### Chinese Language Models

<AccordionGroup>
  <Accordion icon="languages" title="Alibaba Tongyi Series">
    Large language models developed by Alibaba

    **Available 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
  </Accordion>

  <Accordion icon="code" title="DeepSeek Series">
    Models focused on code and reasoning

    **Available Models:**

    * `deepseek-chat` - Dialogue model
    * `deepseek-coder` - Code-specific
    * `deepseek-v2.5` - Latest version

    **Features:**

    * Outstanding code capabilities
    * Strong reasoning ability
    * Open-source friendly
  </Accordion>

  <Accordion icon="brain" title="Zhipu GLM Series">
    Large models developed by Tsinghua University

    **Available 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
  </Accordion>
</AccordionGroup>

## Image Generation Models

### Text-to-Image

| Model ID              | Provider               | Features                      | Price        |
| --------------------- | ---------------------- | ----------------------------- | ------------ |
| `dall-e-3`            | OpenAI                 | High-quality image generation | \$0.04/image |
| `dall-e-2`            | OpenAI                 | Classic image generation      | \$0.02/image |
| `gpt-4o-image`        | Laozhang API optimized | Ultra-high cost-performance   | \$0.01/image |
| `flux-pro`            | Flux                   | Professional-grade quality    | \$0.05/image |
| `flux-dev`            | Flux                   | Development version           | \$0.03/image |
| `midjourney-v6`       | Midjourney             | Strong artistic quality       | \$0.08/image |
| `stable-diffusion-xl` | Stability AI           | Open-source high-quality      | \$0.02/image |

### Image Understanding

| Model ID                 | Provider  | Features                                       | Price            |
| ------------------------ | --------- | ---------------------------------------------- | ---------------- |
| `gpt-4o`                 | OpenAI    | Strong image understanding                     | \$5/1M tokens    |
| `gpt-4o-mini`            | OpenAI    | Lightweight image understanding                | \$0.15/1M tokens |
| `gemini-3.1-pro-preview` | Google    | Multimodal understanding, long context         | Check console    |
| `claude-opus-4-7`        | Anthropic | Document image understanding, complex analysis | Check console    |

## Audio Models

### Text-to-Speech (TTS)

| Model ID   | Provider | Features                         | Price              |
| ---------- | -------- | -------------------------------- | ------------------ |
| `tts-1`    | OpenAI   | Standard speech synthesis        | \$15/1M characters |
| `tts-1-hd` | OpenAI   | High-definition speech synthesis | \$30/1M characters |

### Speech-to-Text (STT)

| Model ID    | Provider | Features                        | Price          |
| ----------- | -------- | ------------------------------- | -------------- |
| `whisper-1` | OpenAI   | Multilingual speech recognition | \$0.006/minute |

## Usage Recommendations

### Select Models by Scenario

<CardGroup cols={2}>
  <Card title="Daily Conversations" icon="message-circle" href="/en/api-reference/chat-completions">
    Recommended: GPT-5.5, Claude Sonnet 4.6, Gemini 3 Flash Preview
    Features: Fast response, low cost, good quality
  </Card>

  <Card title="Code Generation" icon="code" href="/en/api-reference/openai">
    Recommended: GPT-5.5, Claude Opus 4.7, Claude Sonnet 4.6
    Features: Strong code understanding, high generation quality
  </Card>

  <Card title="Complex Reasoning" icon="brain" href="/en/api-capabilities/model-info">
    Recommended: GPT-5.5, o3-pro, Claude Opus 4.7 Thinking
    Features: Strong logical reasoning, suitable for math problems
  </Card>

  <Card title="Chinese Processing" icon="languages" href="/en/api-capabilities/model-info">
    Recommended: Tongyi Qianwen, GLM-4, Wenxin Yiyan
    Features: Excellent Chinese understanding and generation
  </Card>
</CardGroup>

### Cost-Performance Selection

<AccordionGroup>
  <Accordion icon="dollar-sign" title="Budget Priority">
    **Recommended Models:**

    * `gpt-4.1-mini`
    * `claude-haiku-4-5`
    * `gemini-3.1-flash-lite-preview`
    * `deepseek-chat`

    **Suitable Scenarios:**

    * Large-scale text processing
    * Batch data analysis
    * Development and testing phases
  </Accordion>

  <Accordion icon="zap" title="Performance Priority">
    **Recommended Models:**

    * `gpt-5.5`
    * `claude-opus-4-7`
    * `claude-opus-4-7-thinking`
    * `gemini-3.1-pro-preview`

    **Suitable Scenarios:**

    * Critical business applications
    * Complex reasoning tasks
    * High-quality content generation
  </Accordion>

  <Accordion icon="scale" title="Balanced Choice">
    **Recommended Models:**

    * `claude-sonnet-4-6`
    * `gpt-5`
    * `gemini-2.5-pro`
    * `o4-mini`

    **Suitable Scenarios:**

    * Daily business applications
    * Medium-complexity tasks
    * Long-term stable usage
  </Accordion>
</AccordionGroup>

## Real-time Model Information Retrieval

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

```python theme={null}
import requests

# Get model list
response = requests.get(
    "https://api2.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 Code | Description              | Solution                               |
| ---------- | ------------------------ | -------------------------------------- |
| 401        | Invalid API Key          | Check if API Key is correct            |
| 403        | Insufficient permissions | Confirm API Key has access permissions |
| 404        | Model does not exist     | Check if model ID is correct           |
| 429        | Too many requests        | Reduce request frequency               |
| 500        | Server error             | Retry later or contact support         |

***

<CardGroup cols={2}>
  <Card title="View Complete Model List" icon="list" href="/en/api-capabilities/model-info">
    View detailed information and pricing for all 200+ AI models
  </Card>

  <Card title="Start Using Chat API" icon="message-circle" href="/en/api-reference/chat-completions">
    Learn how to call models using Chat Completions API
  </Card>
</CardGroup>
