# Ocost API
> What the Ocost API does (read business documents into structured data, search them), its address, keys, format and routes.

Send Ocost your business documents, such as invoices, orders and contracts. Ocost reads, files, books and matches them, and you get each one back as structured JSON. You can also search everything your business keeps in Ocost.

| What | Value |
| --- | --- |
| Address | `https://api.ocost.io/public/v1` |
| Key | `Authorization: Bearer ocost_sk_…`, from [Settings › Developers](https://app.ocost.io/settings/api) |
| Format | JSON, files as `multipart/form-data`, errors as RFC 9457 problems |
| Documents | [`ocost.document.v1`](https://ocost.io/docs/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://ocost.io/docs/en/quickstart.md). The [API reference](https://ocost.io/docs/openapi.json) has every field. What Ocost reads in each country is under [Germany](https://ocost.io/docs/en/germany.md) and [Ukraine](https://ocost.io/docs/en/ukraine.md).

## Using with AI assistants

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

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

A prompt for an Odoo integration:

```text
Read https://ocost.io/docs/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.
```

## See also

- [Quickstart](https://ocost.io/docs/en/quickstart.md): Five steps to the first invoice as JSON: sign up, make a key, send a PDF, wait until it is read, read its document. curl, Python and JavaScript.
- [Send a file and read it](https://ocost.io/docs/en/files.md): Send a file, send it again safely, wait until it is read, read its documents, get the original, delete it.
- [Connect an assistant](https://ocost.io/docs/en/mcp.md): Connect an assistant to the MCP server (https://api.ocost.io/public/mcp, the same keys): Claude Code, Claude Desktop, Cursor, claude.ai and ChatGPT through OAuth, and any client.
- [The document](https://ocost.io/docs/en/document.md): The ocost.document.v1 schema in EN 16931 terms (maps to UBL and CII): an example, kind and direction, sources, checks, versions, and every field and value.
- On ocost.io: [API and MCP](https://ocost.io/en/product/api-and-mcp), [Pricing](https://ocost.io/en/pricing)
