Sign in

Ocost API

View as Markdown

Send Ocost a business document, get it back as JSON, and search everything your business keeps there.

  • Base address: https://api.ocost.io/public/v1
  • Key: Authorization: Bearer ocost_sk_…, from Settings › API
  • Format: JSON; files as multipart/form-data; errors as RFC 9457 problems
  • Documents: invoices, credit notes, receipts, delivery notes, orders, quotes, contracts, statements, reminders, as ocost.document.v1 in EN 16931 terms (maps to UBL and CII)
  • Where: Ocost runs in the EU; documents never train a model

The routes

RouteDoes
POST /public/v1/filesSend a file
GET /public/v1/filesFiles changed since a time or cursor
GET /public/v1/files/{file_id}A file and its status
GET /public/v1/files/{file_id}/contentThe original bytes
GET /public/v1/files/{file_id}/documentIts first document
GET /public/v1/documents/{document_id}Any document
DELETE /public/v1/files/{file_id}Erase a file for good
GET /public/v1/searchSearch by words and meaning

Start with the Quickstart. Every field is in the API reference, from https://api.ocost.io/public/v1/openapi.json.

Using with AI assistants

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

  • https://app.ocost.io/llms.txt: a map of every guide
  • https://app.ocost.io/llms-full.txt: every guide in one file
  • https://app.ocost.io/developers/openapi.json: the OpenAPI document
  • Copy page for AI, beside each guide's title

A prompt for an Odoo integration:

Text
Read https://app.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.