Skip to navigation

Authentication

Every request carries a bearer token. Generate one in Studio, or sign in with your browser.

All OCPPLab APIs, SDKs, CLIs and MCP servers accept the same credential:

Authorization: Bearer <token>

SDK tokens

Use an SDK token for code, scripts, CI and headless agents.

1

Open SDK tokens

In Studio, open Settings → SDK tokens.

2

Generate a token

Select Generate token and give it a name that says where it runs, for example CI pipeline.

3

Copy it now

The token is shown once. Store it in your secret manager or an environment variable:

export OCPPLAB_TOKEN="<token>"

A token acts as the member who generated it and does not expire. To revoke it, delete it in SDK tokens: anything using it stops working at once.

Never commit a token. Read it from OCPPLAB_TOKEN or your secret manager.

Browser sign-in (OAuth)

The CLI and MCP clients can sign you in with your OCPPLab account instead of a token. You sign in, choose the organization the app may use, and select Allow. The app stores and refreshes its own access.

  • CLI: ocpplab-cli auth login. See ocpplab-cli.
  • MCP: add https://api.ocpplab.io/mcp to Claude Code, Cursor, VS Code, claude.ai or ChatGPT with no credentials. See Connect a client.

Disconnect an app in Studio under Settings → Connected apps.

What a token can see

  • Organization: every result is scoped to the token’s organization. An id from another organization returns 404.
  • Role: admin-only operations, such as removing an OCPI partner, return 403 unless the token belongs to an organization admin.

Use the token

import { OcpplabSDK } from "ocpplab";
const client = new OcpplabSDK({ token: process.env.OCPPLAB_TOKEN! });