# Ocost API

Send Ocost a business document, such as an invoice, an order or a contract. Get it back as JSON, and search everything your business keeps in Ocost.

| What | Value |
| --- | --- |
| Address | `https://api.ocost.io/public/v1` |
| Key | `Authorization: Bearer ocost_sk_…`, from [Settings › API](https://app.ocost.io/settings/api) |
| Format | JSON, files as `multipart/form-data`, errors as RFC 9457 problems |
| Documents | [`ocost.document.v1`](https://docs.ocost.io/en/document.md), in EN 16931 terms |
| Where | The EU. Documents never train a model. |

## The routes

| Route | Does |
| --- | --- |
| `POST /public/v1/files` | Send a file |
| `GET /public/v1/files` | Files changed since a time or cursor |
| `GET /public/v1/files/{file_id}` | A file and its status |
| `GET /public/v1/files/{file_id}/content` | The original bytes |
| `GET /public/v1/files/{file_id}/document` | Its first document |
| `GET /public/v1/documents/{document_id}` | Any document |
| `DELETE /public/v1/files/{file_id}` | Erase a file for good |
| `GET /public/v1/search` | Search by words and meaning |

Start with the [Quickstart](https://docs.ocost.io/en/quickstart.md). The [API reference](https://docs.ocost.io/openapi.json) has every field.

## Using with AI assistants

Claude, ChatGPT, Cursor and other assistants read these guides as Markdown:

- `https://docs.ocost.io/llms.txt`: a map of every guide
- `https://docs.ocost.io/llms-full.txt`: every guide in one file
- `https://docs.ocost.io/openapi.json`: the OpenAPI document
- **Copy page for AI**, beside each title

A prompt for an Odoo integration:

```text
Read https://docs.ocost.io/llms.txt and the guides it links, the Odoo guide first. Then write an Odoo 19 module that sends the PDF of a draft vendor bill to the Ocost API, polls the file until it is read, and fills the bill's partner, number, dates and lines from its ocost.document.v1 without posting it. Keep the API key in the system parameter ocost.api_key.
```
