# Quickstart

> Install the blackthorn CLI, log in with your API key, and chat, or point an OpenAI or Anthropic SDK at it.

Requests are encrypted on your machine before they leave it and decrypted only inside the GPU. The `blackthorn` CLI does the encryption: it chats in your terminal, or serves an API on localhost that OpenAI and Anthropic SDKs, Claude Code and Codex can use.

## Prerequisites

- Linux or macOS, on `x86_64` or `aarch64`.
- An API key from the [Blackthorn portal](https://www.arcium.com/blackthorn/portal).

## Steps

<Steps>
  <Step title="Install the CLI">
    ```bash
    v=$(curl -fsS https://bin.arcium.com/download/blackthorn/latest)
    curl -fsSLo blackthorn "https://bin.arcium.com/download/blackthorn/blackthorn_$(uname -m | sed s/arm64/aarch64/)_$(uname -s | tr A-Z a-z | sed s/darwin/macos/)_$v"
    chmod +x blackthorn && sudo mv blackthorn /usr/local/bin/
    blackthorn --version
    ```
  </Step>

  <Step title="Log in">
    ```bash
    blackthorn login
    ```

    Paste your API key when asked. It is not echoed. To check everything is in place, run `blackthorn status`. It confirms the host accepts your key, names the model, and checks the attestation: every MPC party vouches for the GPU serving you, the GPU's own evidence holds up to NVIDIA's root, and your session's keys are bound to the model. `blackthorn verify` makes the same checks without a key. See [Attestation](/blackthorn/attestation).
  </Step>

  <Step title="Chat">
    ```bash
    blackthorn chat "What is the capital of France?"
    ```

    Run `blackthorn chat` with no prompt for a conversation. `/continue` extends an answer that hit its length limit, and `/new` starts over.
  </Step>

  <Step title="Use it from code">
    ```bash
    blackthorn serve
    # -> OpenAI's API on http://127.0.0.1:8000/v1, Anthropic's on http://127.0.0.1:8000
    ```

    Keep it running and send requests to it. Any API key works there: `serve` authenticates with your `blackthorn login`.

    <CodeGroup>
    ```bash curl
    curl http://127.0.0.1:8000/v1/chat/completions \
      -H "Content-Type: application/json" \
      -d '{
        "model": "qwen3.8-27b-bllm",
        "messages": [{"role": "user", "content": "What is the capital of France?"}],
        "max_tokens": 256
      }'
    ```

    ```python Python (OpenAI)
    from openai import OpenAI

    client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="unused")  # auth is your blackthorn login

    messages = [{"role": "user", "content": "What is the capital of France?"}]
    reply = client.chat.completions.create(model="qwen3.8-27b-bllm", messages=messages, max_tokens=256)
    print(reply.choices[0].message.content)

    # Follow-ups: resend the earlier turns exactly as returned, plus one new user message
    messages += [
        {"role": "assistant", "content": reply.choices[0].message.content},
        {"role": "user", "content": "And of Germany?"},
    ]
    stream = client.chat.completions.create(model="qwen3.8-27b-bllm", messages=messages, stream=True)
    for chunk in stream:
        print(chunk.choices[0].delta.content or "", end="", flush=True)
    ```

    ```js JavaScript (OpenAI)
    import OpenAI from "openai";

    const client = new OpenAI({ baseURL: "http://127.0.0.1:8000/v1", apiKey: "unused" });

    const stream = await client.chat.completions.create({
      model: "qwen3.8-27b-bllm",
      messages: [{ role: "user", content: "What is the capital of France?" }],
      stream: true,
    });
    for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
    ```

    ```python Python (Anthropic)
    from anthropic import Anthropic

    client = Anthropic(base_url="http://127.0.0.1:8000", api_key="unused")  # auth is your blackthorn login

    reply = client.messages.create(
        model="qwen3.8-27b-bllm",
        max_tokens=256,
        messages=[{"role": "user", "content": "What is the capital of France?"}],
    )
    print(reply.content[0].text)
    ```
    </CodeGroup>
  </Step>
</Steps>

To run Claude Code or Codex on the engine, start `blackthorn serve` and run `blackthorn claude` or `blackthorn codex`. See [Coding agents](/blackthorn/coding-agents).

## Differences from OpenAI's and Anthropic's APIs

- The context is 262,144 tokens (256k), prompt and answer together, with `blackthorn` 0.5.0 or newer; older versions get 32,768. A longer prompt is refused with `prompt is too long`. A long prompt the engine has not read before takes a while, since the engine reads all of it before it answers.
- System messages, tools and tool calls work. With `blackthorn` 0.6.0 or newer, so do `tool_choice` (a required call or a named tool) and turning parallel calls off, and `serve` runs Anthropic's web fetch and tool search tools itself. Other tools that OpenAI or Anthropic run on their own servers, such as web search, are left out. See [Other agents](/blackthorn/coding-agents#other-agents).
- No images. OpenAI's Chat Completions API refuses them; Anthropic's API and OpenAI's Responses API replace each with a note that it was left out.
- OpenAI's Responses API (`/v1/responses`) stores nothing: send the whole conversation in `input` every time. `previous_response_id` is refused.
- An omitted `temperature` takes the model's default, listed in [Models and GPUs](/blackthorn/models). `temperature` and `top_p` work as usual. `top_k` and stop strings (`stop`, `stop_sequences`) work in Chat Completions and Anthropic's API, and Chat Completions also takes `seed` and `repetition_penalty`.
- `frequency_penalty`, `presence_penalty`, `logprobs` and `n > 1` are not supported.
- Requests must come from your own machine: `Host` `localhost` or `127.0.0.1`, no `Origin` of another site, and `Content-Type: application/json`. A web page can't use the API through your browser.

<Note>
The engine keeps each conversation open. A follow-up that resends the earlier turns exactly as they were returned sends only what is new. Anything else starts a new conversation, and the engine reads the whole prompt again.
</Note>

## Next

- [Coding agents](/blackthorn/coding-agents): run Claude Code or Codex on the engine with `blackthorn claude` or `blackthorn codex`.
- [Usage and errors](/blackthorn/usage-and-errors): how token usage, stop reasons and errors are reported.
- [How it works](/blackthorn/what-it-is#how-it-works): why the host can't read your prompts.
