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

# Call the Boole AI REST API with cURL — HTTP Examples

> Make direct HTTP requests to the Boole AI API using cURL — ideal for testing endpoints, debugging responses, and writing shell scripts.

cURL lets you call the Boole AI API directly from the command line — no SDK, no runtime, just HTTP. It's the fastest way to test an endpoint, inspect a raw response, or wire Boole into a shell script. All endpoints accept JSON and return JSON, or a stream of server-sent events when you enable streaming.

## Set Your API Key

Export your API key once per shell session so you can reference it in every subsequent command.

```bash theme={null}
export BOOLE_API_KEY="your-api-key-here"
```

<Tip>
  Add that line to your shell profile (`~/.zshrc`, `~/.bashrc`) so it's available in every new terminal. For production scripts, pull the key from your secret manager instead of hardcoding it.
</Tip>

## Chat Completion

Send a `POST` request to `/v1/chat/completions` with a JSON body containing your model name and message array.

```bash theme={null}
curl https://api.boole.dev/v1/chat/completions \
  -H "Authorization: Bearer $BOOLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama-3.3-70b-instruct",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is the capital of France?"}
    ]
  }'
```

<Tip>
  Pipe the output to `jq` for readable, syntax-highlighted JSON: `curl ... | jq .`
  Add `-s` (silent) to suppress the progress bar when piping: `curl -s ... | jq .`
</Tip>

## Streaming

Add `"stream": true` to the request body and `--no-buffer` to the cURL flags so tokens are written to your terminal as soon as Boole sends them.

```bash theme={null}
curl https://api.boole.dev/v1/chat/completions \
  -H "Authorization: Bearer $BOOLE_API_KEY" \
  -H "Content-Type: application/json" \
  --no-buffer \
  -d '{
    "model": "llama-3.3-70b-instruct",
    "messages": [{"role": "user", "content": "Tell me a story."}],
    "stream": true
  }'
```

Each line in the response is a server-sent event in the format `data: {...}`. The stream ends with `data: [DONE]`.

## List Models

Retrieve the full list of models available on your account with a `GET` request — no request body required.

```bash theme={null}
curl https://api.boole.dev/v1/models \
  -H "Authorization: Bearer $BOOLE_API_KEY"
```

## Audio Transcription

Submit an audio file for transcription using `multipart/form-data`. Boole routes this to Whisper Large v3, priced at \$0.02 per minute of audio.

```bash theme={null}
curl https://api.boole.dev/v1/audio/transcriptions \
  -H "Authorization: Bearer $BOOLE_API_KEY" \
  -F file=@audio.mp3 \
  -F model=whisper-large-v3
```

<Info>
  Replace `audio.mp3` with the path to any supported audio file. Whisper Large v3 accepts MP3, MP4, MPEG, MPGA, M4A, WAV, and WEBM formats.
</Info>

## Local Binary

When calling a locally running Boole binary, replace the base URL with `http://localhost:8000`. No `Authorization` header is required — the local server does not validate API keys.

```bash theme={null}
curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama-3.3-70b-instruct",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

<Note>
  Omit the `Authorization` header entirely for local deployments — including it won't cause an error, but it isn't needed. All other request and response fields are identical to the cloud API.
</Note>
