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

# LithosAI API

LithosAI provides an OpenAI-compatible API. Use any OpenAI client library, such as [the official OpenAI SDK](https://developers.openai.com/api/docs/libraries?language=python#install-an-official-sdk), to access the LithosAI API.

## Base URL

Use the `https://api.lithosai.cloud/v1` base URL for all requests to the LithosAI API.

## Your first request

Create a key on the [API Keys](https://console.lithosai.cloud/keys) page, export it as `LITHOSAI_API_KEY`, and send a request.

<CodeGroup>
  ```python Python theme={null}
  import os

  from openai import OpenAI

  client = OpenAI(
      api_key=os.environ["LITHOSAI_API_KEY"],
      base_url="https://api.lithosai.cloud/v1",
  )

  response = client.chat.completions.create(
      model="moonshotai/Kimi-K3",
      messages=[{"role": "user", "content": "Hello"}],
  )
  print(response.choices[0].message.content)
  ```

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

  const client = new OpenAI({
    apiKey: process.env.LITHOSAI_API_KEY,
    baseURL: "https://api.lithosai.cloud/v1",
  });

  const response = await client.chat.completions.create({
    model: "moonshotai/Kimi-K3",
    messages: [{ role: "user", content: "Hello" }],
  });
  console.log(response.choices[0].message.content);
  ```

  ```bash curl theme={null}
  curl https://api.lithosai.cloud/v1/chat/completions \
    -H "Authorization: Bearer $LITHOSAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"model":"moonshotai/Kimi-K3","messages":[{"role":"user","content":"Hello"}]}'
  ```
</CodeGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Create a key and authorize your requests.
  </Card>

  <Card title="Chat Completions" icon="message" href="/chat-completions">
    Send prompts and stream tokens back.
  </Card>

  <Card title="Coding Agents" icon="terminal" href="/coding-agents">
    Run Codex, Claude Code and OpenCode on LithosAI models.
  </Card>

  <Card title="Rate limits" icon="gauge" href="/rate-limits">
    Three per-minute budgets, and how to read them.
  </Card>

  <Card title="Billing" icon="credit-card" href="/billing">
    Prepaid credit, per-token rates and automatic reload.
  </Card>
</CardGroup>
