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

# Key. Base URL. First call.

> Three steps from zero to a response. If you are wiring up a coding agent, one command does all three — see the fast paths at the bottom.

## 1 · Get a key

Create a key in the dashboard under `/dashboard/api`. Keys are prefixed `lx1_` and
shown once at creation — store yours in an environment variable, not in code.

```sh theme={null}
export LAYERX1_API_KEY=lx1_your_key
```

## 2 · Set the base URL

Everything is served from one origin. OpenAI-style clients append `/v1`;
Anthropic-style clients use the bare origin (their SDKs add `/v1/messages`
themselves).

```sh title="One origin, both dialects" theme={null}
# OpenAI SDKs / OpenAI-compatible tools
https://api.layerx1.com/v1

# Anthropic SDKs / Claude Code
https://api.layerx1.com
```

## 3 · Make the first call

<CodeGroup>
  ```sh curl theme={null}
  curl https://api.layerx1.com/v1/chat/completions \
    -H "authorization: Bearer $LAYERX1_API_KEY" \
    -H "content-type: application/json" \
    -d '{
      "model": "lx1-gpt-oss-120b",
      "messages": [{ "role": "user", "content": "Say hello." }]
    }'
  ```

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

  client = OpenAI(
      base_url="https://api.layerx1.com/v1",
      api_key="lx1_your_key",
  )

  r = client.chat.completions.create(
      model="lx1-gpt-oss-120b",
      messages=[{"role": "user", "content": "Say hello."}],
  )
  print(r.choices[0].message.content)
  ```

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

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

  const r = await client.chat.completions.create({
    model: "lx1-gpt-oss-120b",
    messages: [{ role: "user", content: "Say hello." }],
  });
  console.log(r.choices[0].message.content);
  ```
</CodeGroup>

Swap `lx1-gpt-oss-120b` for any model in the [catalog](/models) — every plan
includes all of them. Set `stream: true` for tokens as they are generated (see
[Streaming](/guides/streaming)).

<Note>
  The Anthropic dialect works the same way: POST to `/v1/messages` with your key in
  `x-api-key`. Both dialects accept every model in the catalog. See the
  [API reference](/api/overview).
</Note>

## Fast paths for coding agents

The `layerx1` CLI configures popular coding agents in one command — no install,
safe to re-run:

```sh theme={null}
npx layerx1
```

<CardGroup cols={2}>
  <Card title="Claude Code" href="/guides/claude-code">
    Four environment variables and Claude Code runs on the Layer X1 catalog.
  </Card>

  <Card title="Codex CLI" href="/guides/codex">
    One provider block in config.toml, wire\_api = responses.
  </Card>

  <Card title="Cursor" href="/guides/cursor">
    OpenAI-compatible base URL + key in the model settings.
  </Card>

  <Card title="Other tools" href="/guides/other-tools">
    Aider, Continue, and Cline — exact config for each.
  </Card>
</CardGroup>
