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

# Quick Start

> Get started with APIYI in just three simple steps to access various AI models.

## Step 1: Account Setup

### 1.1 Register Account

Visit [APIYI Website](https://api.apiyi.com) to register:

* Register with email (university or corporate email recommended)
* Verify email address
* Login to console

### 1.2 Account Top-up

Top up your account in the console:

1. Click "Top-up" menu
2. Select top-up amount (minimum \$5, higher amounts get more bonuses, [view promotion policy](/faq/recharge-promotions))
3. Complete payment (Alipay, WeChat supported)

<Note>
  New users get extra bonus on first top-up. Balance is credited immediately. For first-time bonus credits, [contact us on Enterprise WeChat](https://work.weixin.qq.com/kfid/kfc9adfd5810ece25ec) for manual credit.
</Note>

## Step 2: Create API Key

### 2.1 Generate Key

1. In the backend navigation, click "Token" section: [https://api.apiyi.com/token](https://api.apiyi.com/token)
2. You can copy the \[Default Token] directly (there's a Copy icon on the right)
3. Or create a new token: Click the "New" button in the upper right, name your key (e.g., test-key), click confirm to create a new token.

## Step 3: Start Calling

### 3.1 Get Access Information

* **API Address (Base\_Url)**: `https://api.apiyi.com`
* **API Key**: The key you just created
* **Request Format**: Fully compatible with OpenAI API format

### 3.2 Test Call

Quick test using curl:

```bash theme={null}
curl https://api.apiyi.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4.1-mini",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

### 3.3 Code Examples

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(
        api_key="YOUR_API_KEY",
        base_url="https://api.apiyi.com/v1"
    )

    response = client.chat.completions.create(
        model="gpt-4.1-mini",
        messages=[
            {"role": "user", "content": "Hello!"}
        ]
    )

    print(response.choices[0].message.content)
    ```
  </Tab>

  <Tab title="Node.js">
    ```javascript theme={null}
    import OpenAI from 'openai';

    const openai = new OpenAI({
      apiKey: 'YOUR_API_KEY',
      baseURL: 'https://api.apiyi.com/v1'
    });

    const response = await openai.chat.completions.create({
      model: 'gpt-4.1-mini',
      messages: [{ role: 'user', content: 'Hello!' }]
    });

    console.log(response.choices[0].message.content);
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    // Using official OpenAI Java library
    OpenAiService service = new OpenAiService(
        "YOUR_API_KEY",
        Duration.ofSeconds(60),
        "https://api.apiyi.com/v1"
    );

    ChatCompletionRequest request = ChatCompletionRequest.builder()
        .model("gpt-4.1-mini")
        .messages(List.of(
            new ChatMessage(ChatMessageRole.USER, "Hello!")
        ))
        .build();

    ChatCompletionResult result = service.createChatCompletion(request);
    System.out.println(result.getChoices().get(0).getMessage().getContent());
    ```
  </Tab>
</Tabs>

## Next Steps

Congratulations! You've successfully integrated APIYI. Next, you can:

<CardGroup cols={2}>
  <Card title="View API Documentation" icon="book" href="/en/api-manual">
    Learn about complete API interface documentation
  </Card>

  <Card title="Explore Model List" icon="bot" href="/en/api-capabilities/model-info">
    View all supported AI models
  </Card>

  <Card title="Integrate into Apps" icon="plug" href="/en/scenarios/engineering/langchain">
    Integrate APIYI into various tools
  </Card>

  <Card title="View Usage Statistics" icon="chart-line" href="https://api.apiyi.com/log">
    Monitor usage in console
  </Card>
</CardGroup>

## FAQ

### How to switch models?

Simply modify the `model` parameter in your request:

```json theme={null}
{
  "model": "gpt-4.1",                     // Use GPT-4.1
  "model": "claude-sonnet-4-20250514",    // Use Claude 4 Sonnet
  "model": "gemini-2.5-pro"               // Use Gemini 2.5 Pro
}
```

### Which programming languages are supported?

APIYI is compatible with OpenAI API standards and supports all languages that OpenAI SDKs support:

* Python
* JavaScript/TypeScript
* Java
* C#/.NET
* Go
* Ruby
* PHP
* And more...

### How to check balance?

Login to [Console](https://api.apiyi.com/account/profile) to view:

* Account balance
* Usage history
* Consumption statistics

You can also query programmatically via API:

* [Balance Query API](/en/api-capabilities/balance-query): Get account balance, expiry date, and more via API
* [Balance Alert Setup](/en/faq/balance-alerts): Auto-notify on low balance to avoid service interruption

### What if I encounter problems?

1. Check [API Documentation](/en/api-manual)
2. Review [Common Errors](/en/faq/invalid-api-key)
3. Contact support: [support@apiyi.com](mailto:support@apiyi.com)

<Info>
  Tip: Save your API key securely and regularly check usage logs in the console. Every request has message history for cost optimization.
  Happy using!
</Info>
