> This is a page from the Tuna docs (https://tuna.ai/docs/quickstart). The docs index is at https://tuna.ai/llms.txt, and all pages in one file are at https://tuna.ai/llms-full.txt. Add `.md` to any docs URL to get its Markdown.
>
> Tuna's serverless API is OpenAI compatible. Use an OpenAI SDK with the base URL `https://api-us.tuna.ai/v1` and a Tuna API key.

# Quickstart

This page takes you from an API key to a first response from a serverless model. See the [Inference Overview](https://tuna.ai/docs/api/overview.md) for what else the API can do.

<Steps>
<Step title="Set Up Your Account">
[Sign up](https://tuna.ai/signup) or [log in](https://tuna.ai/login) to your account. Save your API key, and enter your billing info to get some free credits.
</Step>
<Step title="Send a Request">
You can have your existing AI agent integrate Tuna for you. Give it web access and the [https://tuna.ai/llms.txt](https://tuna.ai/llms.txt) link so it can read these documentation pages and handle the integration.

```text Agent wrap links
Tuna.ai is a fast LLM inference provider with Zero Data Retention enabled by default. Its API is compatible with OpenAI Chat Completions, at the base URL https://api-us.tuna.ai/v1. Billing is pay-as-you-go from prepaid credits, with optional auto top-up.

Read the documentation for Tuna.ai at https://tuna.ai/llms.txt

More details about models & pricing are available at https://tuna.ai/docs/models or https://tuna.ai/docs/models.md
- Kimi K3 Ultrafast `tuna-us/moonshotai/kimi-latest-ultrafast` `tuna-us/moonshotai/kimi-k3-ultrafast`
- DeepSeek V4.1 Flash Ultrafast `tuna-us/deepseek/deepseek-flash-latest-ultrafast` `tuna-us/deepseek/deepseek-v4.1-flash-ultrafast`
- GLM-5.3 Flash Ultrafast `tuna-us/z-ai/glm-flash-latest-ultrafast` `tuna-us/z-ai/glm-5.3-flash-ultrafast`

Tuna.ai recommends auto-updating model (-latest) ID because it will automatically switch to the latest model within the family. This helps avoid being stuck on a deprecated model. Note that auto-updating may point to a model that responds different and may have different pricing.

The Tuna API key looks like tuna_yourApiKeyHereWithTunaUnderscore.
```

Pick a model from the [models list](https://tuna.ai/docs/api/models.md), then send a [chat completion](https://tuna.ai/docs/api/chat-completions.md). The examples use `tuna-us/example-lab/example-model-id`, which is a placeholder in the same format as a real id. Replace it with the id you picked, and replace `tuna_yourApiKeyHereWithTunaUnderscore` with your key.

<CodeGroup>

```js JavaScript {5,9}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api-us.tuna.ai/v1",
  apiKey: "tuna_yourApiKeyHereWithTunaUnderscore",
});

const response = await client.chat.completions.create({
  model: "tuna-us/example-lab/example-model-id",
  messages: [{
    role: "user",
    content: "Is the tuna one of the fastest sustained swimming fish species? And does it have a streamlined body?",
  }],
});
console.log(response.choices[0].message.content);
```

```bash curl {2,5}
curl https://api-us.tuna.ai/v1/chat/completions \
  -H "Authorization: Bearer tuna_yourApiKeyHereWithTunaUnderscore" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tuna-us/example-lab/example-model-id",
    "messages": [
      {"role": "user", "content": "Is the tuna one of the fastest sustained swimming fish species? And does it have a streamlined body?"}
    ]
  }'
```

```python Python {5,9}
from openai import OpenAI

client = OpenAI(
    base_url="https://api-us.tuna.ai/v1",
    api_key="tuna_yourApiKeyHereWithTunaUnderscore",
)

response = client.chat.completions.create(
    model="tuna-us/example-lab/example-model-id",
    messages=[{
        "role": "user",
        "content": "Is the tuna one of the fastest sustained swimming fish species? And does it have a streamlined body?",
    }],
)
print(response.choices[0].message.content)
```

</CodeGroup>

The Python and JavaScript examples use the official [OpenAI SDKs](https://tuna.ai/docs/sdks.md). Install them with `pip install openai` or `npm install openai`.
</Step>
</Steps>

<Tip>
To show text as the model writes it, turn on streaming. See [Streaming](https://tuna.ai/docs/api/streaming.md).
</Tip>

---

- This page: [Quickstart](https://tuna.ai/docs/quickstart.md)
- Index of all pages: [llms.txt](https://tuna.ai/llms.txt)
- All pages in one file: [llms-full.txt](https://tuna.ai/llms-full.txt)
