# Quick Start

<noscript>
**Notice for AI Agents and Text-Only Browsers:** This page requires JavaScript. For a static, text-based version of the API documentation, please see [LLMS.md](https://github.com/forpublicai/publicai-gateway-developer-portal/blob/main/LLMS.md) or access it directly at https://raw.githubusercontent.com/forpublicai/publicai-gateway-developer-portal/main/LLMS.md
</noscript>

Welcome to the Public AI Inference Utility developer portal.

## 1. Get your API key
Every new user account receives $2 of free starter credit, used for API calls at the listed per-token prices.


1. **Sign up**: Click [Login](/signin) in the top right and sign up
2. **Open Account**: Go to the [Account](/account/billing) tab in the top navigation
3. **Create API key**: Open [API Keys](/settings/api-keys) and click _Create API Key_
4. **Generate**: Enter a name, set expiration, and click _Generate Key_

## 2. Explore available models

See [Available Models](/models) for the full catalog of hosted models, including Swiss AI Apertus, AISingapore SEA-LION, Allen AI Olmo, and more.

You can also list models programmatically:

```bash
curl -X GET https://api.publicai.co/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "User-Agent: MyApp/1.0"
```

**Or try it interactively:**

<OpenPlaygroundButton
  server="https://api.publicai.co/"
  url="/v1/models"
  method="GET"
  headers={[
    { name: "Authorization", defaultValue: "Bearer YOUR_API_KEY_HERE" },
    { name: "User-Agent", defaultValue: "MyApp/1.0" }
  ]}
/>

## 3. Make your first request

Once you have an API key, you can start making requests to our AI models. Here's a simple example:

```bash
curl -X POST https://api.publicai.co/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "User-Agent: MyApp/1.0" \
  -d '{
    "model": "swiss-ai/apertus-v1.5-8b",
    "messages": [
      {
        "role": "user",
        "content": "Hello! Can you help me understand open-source AI?"
      }
    ]
  }'
```

**Or try it interactively:**

<OpenPlaygroundButton
  server="https://api.publicai.co/"
  url="/v1/chat/completions"
  method="POST"
  headers={[
    { name: "Authorization", defaultValue: "Bearer YOUR_API_KEY_HERE" },
    { name: "User-Agent", defaultValue: "MyApp/1.0" },
    { name: "Content-Type", defaultValue: "application/json" }
  ]}
  body={JSON.stringify({
    model: "swiss-ai/apertus-v1.5-8b",
    messages: [
      {
        role: "user",
        content: "Hello! Can you help me understand open-source AI?"
      }
    ]
  })}
/>

## Authentication

All API requests require:

1. **API Key**: Include your key in the Authorization header:
   ```
   Authorization: Bearer YOUR_API_KEY
   ```

2. **User-Agent Header**: Specify a User-Agent to prevent bot spamming:
   ```
   User-Agent: MyApp/1.0
   ```

## Model configuration

Inference parameters vary by model. See each model's Hugging Face card on the [Available Models](/models) page, and use `GET /v1/models` for `context_length` and pricing.

## Rate limits and billing

Rate limits depend on your plan tier. See [Plans & Rate Limits](/plans) for details on Free, Plus, Pro, and Enterprise tiers. Usage and wallet balance are available under Account → [Billing](/account/billing).

## Support

- **API Reference:** Explore the full [API Reference](/api)
- **Community:** Join our discussions at [github.com/forpublicai](https://github.com/forpublicai)
- **Issues:** Report problems via GitHub Issues

## What's next?

- Browse [Available Models](/models) and pick the right model for your use case
- Review [Plans & Rate Limits](/plans) and [Billing](/account/billing) for usage and pricing
- Explore the complete [API Reference](/api) for detailed endpoint documentation
- [Support Us](/support-us) to upgrade to the Plus tier via OpenCollective
