API Keys
Personal access tokens (PATs) let you authenticate with the Pipe2.ai API and MCP server from external tools and code.
Creating a token
- Go to pipe2.ai/api-keys
- Click Create Token With MCP clients:
- Copy the token — it’s only shown once
Using your token
With SDKs:
import { createClient } from '@pipe2-ai/sdk';const client = createClient('YOUR_TOKEN');With MCP clients:
{ "headers": { "Authorization": "Bearer YOUR_TOKEN" }}With raw GraphQL:
curl -X POST https://api.pipe2.ai/v1/graphql \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"query": "{ pipelines { name } }"}'Revoking a token
Click the revoke button next to any token. Revocation takes effect within 30 seconds. The token will stop working for all clients using it.
Key controls
You can have up to 25 active keys per account. Revoked and expired keys free a slot. Set a name, optional allowed pipelines, a credit limit, a reset schedule (none, daily, weekly, monthly, or yearly), and an expiration preset (1, 7, 30, 90, or 365 days). Limits use UTC calendar days, weeks starting Monday, and months. A key with no credit limit can use your available account credits.
A run is blocked when its credit reservation would exceed the key’s remaining limit. Actual charged credits appear in the key list after settlement; refunds release the reservation.
Use pipelines:run to run any pipeline, or add one pipeline:run:SLUG scope per allowed pipeline. You can add several slug-specific scopes to one key. API and MCP requests use only the permissions you select. Permissions and the pipeline selection are fixed at creation; revoke the key and create another to change them. Keep keys for external applications on your server.
mutation { create_personal_access_token( name: "My application" scopes: ["pipeline:run:YOUR_PIPELINE_SLUG", "pipeline:run:ANOTHER_PIPELINE_SLUG"] credit_limit: 100 reset_period: "daily" expires_in_days: 90 ) { token expires_at }}