# API reference

> The Strokes Writing Intelligence HTTP API — base URL, authentication, endpoints and conventions.

Source: https://docs.strokes.ink/api

## Base URL

```
https://api.strokes.ink
```

All endpoints live under `/v1`. Requests and responses are JSON, except a [streamed](/api/streaming-events) reply.

## Authentication

Send your API key in the `x-api-key` header, or as `Authorization: Bearer <key>`. Create keys in the [console](https://platform.strokes.ink). See [Authentication](/get-started/authentication).

```bash
curl https://api.strokes.ink/v1/models \
  -H "x-api-key: $STROKES_API_KEY"
```

## Endpoints

| Method | Path | |
| --- | --- | --- |
| `POST` | [`/v1/messages`](/api/messages) | Send a conversation, get the next message |
| `POST` | [`/v1/chat/completions`](/api/chat-completions) | The same, in OpenAI's Chat Completions format |
| `GET` | [`/v1/models`](/api/models#list-models) | List the models |
| `GET` | [`/v1/models/{model_id}`](/api/models#get-a-model) | Get one model |
| `GET` | [`/v1/strokes`](/api/strokes#list-strokes) | List strokes in your organization |
| `GET` | [`/v1/strokes/{stroke_id}`](/api/strokes#get-a-stroke) | Get a stroke's facts and voice profile |
| `PUT` | [`/v1/strokes/{stroke_id}`](/api/strokes#create-or-replace-a-stroke) | Create or replace a stroke |
| `PATCH` | [`/v1/strokes/{stroke_id}`](/api/strokes#update-a-stroke) | Update facts or voice profile on a stroke |
| `DELETE` | [`/v1/strokes/{stroke_id}`](/api/strokes#delete-a-stroke) | Delete a stroke and its facts |
| `POST` | [`/v1/agent-key`](/console/home#copy-for-agent) | Trade a one-time setup token from **Copy for agent** for an API key |

## Compatibility

`/v1/messages` and `/v1/models` follow the [Anthropic Messages API](https://docs.anthropic.com/en/api/messages): the same paths, fields, objects, stream events and errors. Anthropic's SDKs work with `baseURL` set to `https://api.strokes.ink` or `https://api.strokes.ink/v1`. Headers they send, such as `anthropic-version`, are accepted and ignored. What is and isn't supported is listed in [Create a message](/api/messages). [`/v1/chat/completions`](/api/chat-completions) follows OpenAI's Chat Completions API, so the OpenAI SDKs work with `baseURL` set to `https://api.strokes.ink/v1`; `/v1/models` answers in a shape both SDKs read. `/v1/strokes` and `/v1/agent-key` are Strokes' own.

## Response headers

| Header | |
| --- | --- |
| `request-id` | A unique ID for the request, `req_…`. Include it when you report a problem |
| `strokes-mode` | The [mode](/guides/modes) used for the reply: `business`, `academic` or `creative` (omitted when none was chosen). On `/v1/messages` and `/v1/chat/completions` |

## Limits

There is no requests-per-minute limit. Your organization's credits and each key's monthly spend limit bound usage. See [Limits and spend](/guides/rate-limits).
