Skip to main content
Base URL: https://router.flatkey.ai Flatkey exposes an OpenAI-compatible REST API. If you already have an HTTP client, you do not need an SDK. This page is the shortest path from a key to a working request.

Authenticate

Every request carries your key as a bearer token:
Create a key in the console. Keys start with sk-fk-. Store it in an environment variable and keep it out of source control and browser code.

Send a request

A successful call returns the standard chat completion object with choices and usage.

Available endpoints

POST /v1/responses currently works with OpenAI models. Other families return an error on this endpoint — use POST /v1/chat/completions for them.

Check your balance

Handle errors

Errors return a JSON body with a message you can act on:
Full list in the error reference.

Next steps

API reference

Every endpoint, parameter, and response field.

Use an SDK instead

Keep your OpenAI or Anthropic client and change one line.