Get API key

OpenAPI spec

A machine-readable OpenAPI description of the API, and the interactive explorer built from it.

The full public API is published as an OpenAPI 3.1 document. It is the machine-readable contract for every endpoint in this reference (chat completions, embeddings, rerank, models, audio, and image generation), including request and response shapes, auth, and error codes.

What you can do with it

  • Import into Postman, Insomnia, or Bruno. Point the tool at https://docs.privatemind.com/openapi.yaml and the whole API loads as a ready-to-call collection.
  • Generate client stubs. Feed the spec to openapi-generator to scaffold typed clients in your language.
  • Wire it into your own tooling. The spec is plain YAML: drive contract tests, mock servers, or API gateways from it.
cURL
# Generate a typed client from the published spec
npx @openapitools/openapi-generator-cli generate \
  -i https://docs.privatemind.com/openapi.yaml \
  -g python \
  -o ./privatemind-client

For chat and embeddings, prefer the OpenAI SDK

The API is OpenAI-compatible, so for chat completions and embeddings the simplest integration is the official openai client pointed at our base URL, no code generation needed. See the OpenAI SDK guide.

Python
from openai import OpenAI

client = OpenAI(base_url="https://api.privatemind.com/v1", api_key=PMIND_KEY)

The OpenAPI spec is most useful for the endpoints with no OpenAI-SDK equivalent (rerank, voices), for non-Python languages, and for importing the API into other tooling.

Authentication in the explorer

The explorer's "Try it" console sends requests straight to https://api.privatemind.com/v1 from your browser. Paste a key into the Auth panel to authorise calls. Because the API is intended for server-side use, browser calls may be blocked by CORS; the reference, schemas, and generated code samples work regardless. Never paste a production key into a browser you don't trust.

Where next

  • Authentication for the bearer-token format.
  • Errors for the status-code and error-envelope contract the spec encodes.
  • OpenAI SDK for the zero-codegen path to chat and embeddings.