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

# Quickstart

> Get free credits and start running inference

In just a few minutes, you'll be chatting with the latest open source models
and sending inference requests with the Modular Cloud API.

## Try the playground

Here's how to play with some models without writing any code.

**1. Log in**

Sign up with your work email at [console.modular.com](https://console.modular.com/signup).

**2. Chat with a model**

Click **Playground** in the sidebar and select a shared model from the dropdown.

Now start chatting!

## Run inference with the API

Here's a quick guide to running inference with the chat completions API.

**1. Set your API key**

[Create an API key](https://console.modular.com/api_keys) with **Model
access**, then export it:

```bash macOS/Linux theme={null}
export MODULAR_API_KEY="your_api_key"
```

```bash Windows theme={null}
$env:MODULAR_API_KEY="your_api_key"
```

**2. Install the OpenAI client**

You can skip this if you're going to use cURL.

```bash Python (pip) theme={null}
pip install openai
```

```bash Python (uv) theme={null}
uv init quickstart && cd quickstart
uv add openai
```

```bash Python (pixi) theme={null}
pixi init quickstart && cd quickstart
pixi add openai
```

```bash TypeScript (npm) theme={null}
mkdir quickstart && cd quickstart
npm init -y && npm install openai
```

**3. Copy this code**

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

client = OpenAI(
    base_url="https://api.modular.com/v1",
    api_key=os.environ.get("MODULAR_API_KEY"),
)

response = client.chat.completions.create(
    model="minimax/minimax-m3",
    messages=[{"role": "user", "content": "Hello, how are you?"}],
)

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

```typescript TypeScript theme={null}
import process from "node:process";
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.modular.com/v1",
  apiKey: process.env.MODULAR_API_KEY,
});

async function main() {
  const response = await client.chat.completions.create({
    model: "minimax/minimax-m3",
    messages: [{ role: "user", content: "Hello, how are you?" }],
  });

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

main();
```

```bash cURL theme={null}
curl -X POST https://api.modular.com/v1/chat/completions \
  -H "Authorization: Bearer $MODULAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax/minimax-m3",
    "messages": [{"role": "user", "content": "Hello, how are you?"}]
  }'
```

**4. Run it**

```bash Python (pip) theme={null}
python main.py
```

```bash Python (uv) theme={null}
uv run main.py
```

```bash Python (pixi) theme={null}
pixi run python main.py
```

```bash TypeScript (npm) theme={null}
npx tsx main.ts
```

You should quickly see the response.

That's it! You're up and running.

To try a different model, just change the code's `model` parameter:
Browse the available [shared endpoints](https://console.modular.com/endpoints)
and click a model, then copy the **Model ID** shown on the right.

## Next steps

Check out these guides to learn more about using the Modular Cloud APIs:

* [Text inference](https://docs.modular.com/inference/text.md): text-to-text, image-to-text, and
  video-to-text
* [Image inference](https://docs.modular.com/inference/image.md): generate and transform images with FLUX
* [Video inference](https://docs.modular.com/inference/video.md): generate video from text with Wan
* [AI tool integration](https://docs.modular.com/coding-assistants/cursor.md): use Modular Cloud models in
  Cursor, OpenCode, TRAE, and other AI tools
