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

# Overview

> Fully serverless, OpenAI-compatible inference for OSS models at trillion-token scale.

# Overview

Use Terminal to run OSS models through a fully serverless, OpenAI-compatible API built to scale to trillions of tokens every day.

## Why Terminal for agents

Agent workloads are not one-size-fits-all. An interactive coding step may need fast tokens now, while a background review, eval, or research job can wait if that makes it cheaper.

Terminal lets you choose that tradeoff per request. Use the Standard window for interactive work, use Flex when a job can be patient, and use request-level SLA headers as they become available for finer latency and cost control.

You only pay per token. Terminal is serverless by default, with no deployments to manage and no rate limits to size around.

## Base URL

```text theme={null}
https://api.terminal.fyi/v1
```

## Endpoint

```text theme={null}
POST /chat/completions
```

## Authentication

Terminal is currently invite-based. To request an API key, email [shubham@terminal.fyi](mailto:shubham@terminal.fyi).

All examples in these docs use the placeholder `TERMINAL_API_KEY`.

## First request

<CodeGroup>
  ```python Python SDK theme={null}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.terminal.fyi/v1",
      api_key="TERMINAL_API_KEY",
  )

  completion = client.chat.completions.create(
      model="gemma-4-31b",
      messages=[
          {
              "role": "user",
              "content": "Draft a short launch note for a new usage dashboard.",
          }
      ],
      max_tokens=8000,
  )

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

  ```typescript TypeScript SDK theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.terminal.fyi/v1",
    apiKey: process.env.TERMINAL_API_KEY,
  });

  const completion = await client.chat.completions.create({
    model: "gemma-4-31b",
    messages: [
      {
        role: "user",
        content: "Draft a short launch note for a new usage dashboard.",
      },
    ],
    max_tokens: 8000,
  });

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

  ```python Python HTTP theme={null}
  import requests

  response = requests.post(
      "https://api.terminal.fyi/v1/chat/completions",
      headers={
          "Authorization": "Bearer TERMINAL_API_KEY",
          "Content-Type": "application/json",
      },
      json={
          "model": "gemma-4-31b",
          "messages": [
              {
                  "role": "user",
                  "content": "Draft a short launch note for a new usage dashboard.",
              }
          ],
          "max_tokens": 8000,
      },
      timeout=60,
  )
  response.raise_for_status()

  completion = response.json()
  print(completion["choices"][0]["message"]["content"])
  ```

  ```typescript TypeScript HTTP theme={null}
  const response = await fetch("https://api.terminal.fyi/v1/chat/completions", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.TERMINAL_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "gemma-4-31b",
      messages: [
        {
          role: "user",
          content: "Draft a short launch note for a new usage dashboard.",
        },
      ],
      max_tokens: 8000,
    }),
  });
  if (!response.ok) throw new Error(await response.text());

  const completion = await response.json();
  console.log(completion.choices[0].message.content);
  ```

  ```bash cURL theme={null}
  curl -sS https://api.terminal.fyi/v1/chat/completions \
    -H "Authorization: Bearer $TERMINAL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gemma-4-31b",
      "messages": [
        {
          "role": "user",
          "content": "Draft a short launch note for a new usage dashboard."
        }
      ],
      "max_tokens": 8000
    }' | jq
  ```
</CodeGroup>

## Current models

| Model       | ID            | Good for                                        |
| ----------- | ------------- | ----------------------------------------------- |
| Gemma 4 31B | `gemma-4-31b` | Cheap multimodal/general chat workloads         |
| MiniMax M3  | `minimax-m3`  | Long-context, agentic, and multimodal workloads |

Additional serverless OSS models can be requested. See [Model requests](/model-requests).

## Service windows

| Window   | Use when                     | Behavior                                                 |
| -------- | ---------------------------- | -------------------------------------------------------- |
| Standard | You need interactive latency | Fast responses, 100+ tokens/sec on average               |
| Flex     | You can wait to reduce cost  | Same endpoint waits for completion, usually 5-20 minutes |

## Next steps

* [Quickstart](/quickstart): make your first Chat Completions request.
* [Service tiers](/service-tiers): choose Standard or Flex windows.
* [Models & pricing](/models-pricing): compare current model pricing.
* [Model requests](/model-requests): request models that are not listed yet.
