Skip to main content

Get an API key

Create a key in the dashboard under Settings → API keys. Keys are scoped to one organization, so a key only ever reads that organization’s prompts. Set it in your environment:

Install

Resolve a prompt

The constructor reads ANPORD_API_KEY when you do not pass one. To hold the key yourself:

Create and publish

create makes the prompt and its first version. update appends a version rather than overwriting one, so version 1 stays readable. Until you promote, callers asking for production keep receiving version 1.

Handle failures

Every failure is an AnpordError carrying the status the API returned.
An id that cannot be valid is refused before the request leaves your process, and the message names the field: id: Prompt id must be lowercase alphanumeric, optionally with / _ or -.