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

# Quickstart

> Create an API key, store it in an environment variable, send a chat completions request with cURL, Python, or Node.js, and read token usage in the console.

Model API answers chat completions requests in the OpenAI format. This quickstart creates an API key, sends a first request with cURL or the OpenAI SDK, and shows where the console reports token usage.

> [!NOTE]
>
> Requests are paid from the team balance. Before the first request, sign in to the [console](https://console.ppio.ai) and check on [Billing Overview](https://console.ppio.ai/billing) that the balance covers it.

## Run a first request

**1. Create an API key**

Open [API Keys](https://console.ppio.ai/api-keys) in the console and select **Add New Key**.

> [!WARNING]
>
> Copy the key when it is created. The console does not show it again.

**2. Store the key in an environment variable**

The examples read the key from `PPIO_API_KEY`. Set the variable in the shell that runs the request.

> [tab] macOS and Linux
>
> ```bash theme={null}
> export PPIO_API_KEY="<your-api-key>"
> ```

> [tab] Windows (PowerShell)
>
> ```powershell theme={null}
> $env:PPIO_API_KEY = "<your-api-key>"
> ```
>
> The cURL example uses Bash syntax. In PowerShell, run the Python or Node.js example.

**3. Run the example**

The example sends a chat completions request to `deepseek/deepseek-v4-pro`. Run it in the same shell.

The Python and Node.js examples use the OpenAI SDK. Install it with `pip install openai` or `npm install openai`. Save the Node.js example in a file ending in `.mjs`, because it uses `import` and top-level `await`.

```bash cURL theme={null}
curl "https://api.ppio.com/openai/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${PPIO_API_KEY}" \
  -d '{
    "model": "deepseek/deepseek-v4-pro",
    "messages": [
      {
        "role": "user",
        "content": "Say hello in one sentence."
      }
    ],
    "max_tokens": 64
  }'
```

```python Python theme={null}
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.ppio.com/openai",
    api_key=os.environ["PPIO_API_KEY"],
)

response = client.chat.completions.create(
    model="deepseek/deepseek-v4-pro",
    messages=[{"role": "user", "content": "Say hello in one sentence."}],
    max_tokens=64,
)

print(response.choices[0].message.content)
```

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

const apiKey = process.env.PPIO_API_KEY;
if (!apiKey) throw new Error("PPIO_API_KEY is not set.");

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

const response = await client.chat.completions.create({
  model: "deepseek/deepseek-v4-pro",
  messages: [{ role: "user", content: "Say hello in one sentence." }],
  max_tokens: 64,
});

console.log(response.choices[0].message.content);
```

**4. Check the reply**

> [!TIP]
>
> The call works when `choices[0].message.content` holds a greeting. Python and Node.js print only that field. cURL prints the whole JSON response.

**5. Check usage**

Token usage for Model API requests appears on [Usage](https://console.ppio.ai/usage) under **MODEL APIS** in the console.

## Next steps

Browse [models](https://ppio.ai/models) and [pricing](https://ppio.ai/pricing) on the PPIO website.


## Related topics

- [Create your first sandbox](https://docs.ppio.ai/sandbox/quickstart.md)
- [Monitor sandbox CPU, memory, and disk](https://docs.ppio.ai/sandbox/metrics.md)
- [Query sandbox lifecycle events](https://docs.ppio.ai/sandbox/events.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.