For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
On this page
  • API key format
  • Creating a key
  • Credential resolution order
  • Credentials file
  • Scopes
  • Key rotation
  • Workspace binding
Get Started

Authentication

Was this page helpful?
Previous

Install

Next
Built with

OnePin uses API keys for all programmatic access (SDK and CLI). Browser-based access uses Clerk session tokens, which are not covered here.

API key format

Keys are 32-character base62 strings prefixed op_live_:

op_live_A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6

v0.2: Test-environment keys (op_test_*) are not yet available.

Creating a key

  1. Sign in at app.onepin.ai.
  2. Go to Settings → API Keys.
  3. Click Create key, enter a name, select the scopes you need, and copy the value.

The plaintext value is shown exactly once. Store it in a secrets manager or environment variable immediately.

Credential resolution order

The CLI and SDK resolve credentials from three sources, in priority order:

PrioritySourceHow
1 (highest)--api-key TEXT flagCLI flag or api_key= constructor argument
2ONEPIN_API_KEY environment variableexport ONEPIN_API_KEY=op_live_...
3 (lowest)~/.onepin/credentials fileWritten by onepin login

If no key is found from any source, the SDK raises OnePinConfigurationError and the CLI exits with an error.

Credentials file

onepin login writes a TOML credentials file at ~/.onepin/credentials:

1[default]
2api_key = "op_live_..."
3base_url = "https://api.onepin.ai"

File permissions are enforced on write: 0600 on the file, 0700 on the ~/.onepin/ directory. The SDK and CLI refuse to load credentials from a world-readable file.

v0.2: Named profiles (--profile staging) are not yet implemented. The [default] profile is the only one used in v0.1.

Scopes

Select the minimum set of scopes your key needs.

ScopeDescription
templates:readList and get workflow templates from the gallery
workflows:readList and get workflows in your workspace
workflows:runStart and cancel workflow runs
workflows:writeCreate, update, and delete workflows; clone templates into workflows
voices:readList voices available to your workspace
voices:writeManage voice favorites
uploads:writeCreate upload sessions and confirm uploads
dictionary:readList and search custom pronunciation dictionary entries
dictionary:writeCreate and update dictionary entries
workspace:readRead workspace metadata

Cloning a template into a workflow requires workflows:write — the clone creates a new workflow in your workspace.

Key rotation

Rotate keys every 90 days or immediately after any suspected exposure:

  1. Create a replacement key in the dashboard with the same scopes.
  2. Update ONEPIN_API_KEY in your CI secrets or secrets manager.
  3. Verify the new key with onepin whoami.
  4. Revoke the old key in the dashboard.

Never commit keys to source control. Add ONEPIN_API_KEY to .gitignore and use .env files only for local development.

Workspace binding

Each key is bound to a single workspace at creation time. All resources created via that key — workflows, uploads — belong to that workspace. To operate on a different workspace, create a key under that workspace.

The X-Workspace-Id header is optional on API calls made with an API key; the server derives the workspace from the key. If you supply the header, the value must match the key’s bound workspace or the request is rejected with 403.