# Quickstart (/docs/quickstart)


Get Your API Key [#get-your-api-key]

1. [Sign up](/) for a Yunxin account
2. Navigate to **Dashboard → API Keys**
3. Click **Create API Key** and copy the generated key

<Callout type="warn">
  Store your API key securely. Do not expose it in client-side code or public repositories.
</Callout>

Base URL [#base-url]

<ApiUrl />

This URL is configured via **Dashboard → Admin → Settings**.

Your First Request [#your-first-request]

```
POST /v1/chat/completions
```

<Tabs items="[&#x22;cURL&#x22;, &#x22;Python&#x22;, &#x22;JavaScript&#x22;]">
  <Tab value="cURL">
    ```bash
    curl https://api.yuhuanstudio.com/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "model": "model-id",
        "messages": [
          {"role": "user", "content": "Hello!"}
        ]
      }'
    ```
  </Tab>

  <Tab value="Python">
    ```python
    from openai import OpenAI

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

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

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

  <Tab value="JavaScript">
    ```javascript
    import OpenAI from "openai";

    const client = new OpenAI({
      apiKey: "YOUR_API_KEY",
      baseURL: "https://api.yuhuanstudio.com/v1",
    });

    const response = await client.chat.completions.create({
      model: "model-id",
      messages: [
        { role: "user", content: "Hello!" },
      ],
    });

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

Switch Between Models [#switch-between-models]

Change the `model` parameter to use any supported model — no other code changes needed. Use the [Models API](/docs/models-api) to list available models:

```python
# List available models
models = client.models.list()
for model in models.data:
    print(model.id)

# Use any model
response = client.chat.completions.create(
    model="model-id",
    messages=[{"role": "user", "content": "Hello!"}]
)
```

What's Next? [#whats-next]

<Cards>
  <Card title="Authentication" href="/docs/authentication">
    Learn about API key management and security
  </Card>

  <Card title="Chat Completions" href="/docs/chat-completions">
    Deep dive into the Chat API
  </Card>

  <Card title="Streaming" href="/docs/streaming">
    Enable real-time streaming responses
  </Card>

  <Card title="Models" href="/docs/models-api">
    Browse all available models
  </Card>
</Cards>
