Skip to main content

Overview

Stripe Projects provisions third-party services from your terminal or coding agent. One command creates a Perplexity API project in your own account, mints a key, and writes it to your Stripe project’s .env:
perplexity/api is the service. Once added, update, rotate, and remove refer to it by the resource name perplexity-api, and account-level commands like open, spend, and link take the provider name perplexity. A Perplexity API project is the billing and key boundary in the API Console. The one Stripe Projects creates is a normal project in your account. Open it in the API Console any time to see balance, usage, keys, and billing settings. On this page, “Stripe project” means the directory the CLI manages and “Perplexity API project” means the API project it provisions.

Prerequisites

You don’t need an existing Perplexity account. The add flow creates one from your Stripe-verified email if needed. You do need a payment method on your Stripe account: Stripe asks for one before provisioning any paid service.

Quickstart

1

Initialize a Stripe project

The first run signs you in to Stripe and creates a Stripe project in the current directory. If your Stripe account has no payment method yet, add one now so the next step doesn’t stop at a Checkout page:
2

Add Perplexity

This creates a Perplexity API project, mints a key, and writes it to .env as PERPLEXITY_API_KEY:Creating a new Perplexity API project prompts for a $10 minimum credit purchase, charged to your Stripe account’s payment method. See Billing and credits for the full rules.
3

Make your first request

The official SDKs read PERPLEXITY_API_KEY from the environment. The examples use the low preset, which sets a default model and web search configuration:
If you get text back, the key is live and billing is wired up. The SDKs expose it as output_text; the raw cURL response has it as a message item inside output. The same key works across the API platform, including Agent API and Search API.
To open the Perplexity API project in the API Console and see usage, balance, and keys:

Billing and credits

Perplexity API usage is prepaid: you buy credits, usage draws the balance down. For a Perplexity API project created by Stripe Projects, credit purchases charge your Stripe account’s payment method, so you never enter a card on the Perplexity side. On provision
  • Creating a new dedicated Perplexity API project prompts for a $10 minimum initial credit purchase.
  • If you already administer a Perplexity API project, the CLI offers to connect it instead of creating a new one. Connected projects keep their existing Perplexity billing, so credit purchases for them stay in the API Console (see Connect an existing Perplexity API project).
Top up after provisioning
The CLI prompts for these when needed, and agents pass them with --config. The same settings are editable in the API Console, and changes from either place apply to the same Perplexity API project. Check spend
Stripe applies a monthly spending limit per provider. Adjust it with stripe projects billing update --limit 50 --provider perplexity. A purchase that would exceed the limit is declined; raise the limit and retry. If you run out of credits, the key is blocked until you add more. Enable auto_recharge ahead of time so credits are added automatically when the balance runs low.

Connect an existing Perplexity API project

Your Stripe account connects to exactly one Perplexity API project. The first time you run add, if your Stripe-verified email already administers Perplexity API projects, the CLI asks whether to create a new one or connect an existing one:
  • Create a new dedicated Perplexity API project (recommended)
  • One of your existing Perplexity API projects, listed by name
Each additional Stripe project you run add in gets its own API key, all minted inside that one Perplexity API project. Other users on the same Stripe account can run add too, but only if they are an Admin of that Perplexity API project. You can also make this choice up front, before adding Perplexity to a Stripe project:
If you connect an existing Perplexity API project, it keeps its existing Perplexity billing. Credit purchases through Stripe Projects open that project’s billing page in the API Console instead of charging your Stripe payment method. Only keys minted through Stripe Projects are visible to Stripe; your other keys are not.

Rotate or remove the key

  • Rotate mints a fresh key and updates .env. The old key keeps working for 24 hours so running deployments don’t break mid-rotation.
  • Remove deprovisions this Stripe project’s key. Your Perplexity API project, credits, and any other keys are untouched, and it stays visible in the API Console.
remove revokes immediately, including a rotated-out key still inside its 24-hour grace window.
To disconnect Perplexity from your Stripe account entirely, delete the Perplexity API project in the API Console. That revokes every key in it and releases the Stripe account, so the next add creates or connects a fresh Perplexity API project. The console only deletes a project whose credit balance is zero. stripe projects unlink perplexity only forgets the connection in the current Stripe project directory; the Perplexity API project and its keys are untouched, and link reconnects to it.

Use with coding agents

Claude Code, Cursor, Codex, and other agents can run the full add flow non-interactively.
1

Install the agent skill

stripe projects init writes a skill into the Stripe project (Claude Code, Cursor, and AGENTS.md variants):To install the skill globally instead:
2

Authorize once

Attach a payment method before the agent session so it never hits a browser prompt:
3

Let the agent provision

Agents use the non-interactive form. --confirm-paid-service is required when a purchase is involved:
Then try a prompt like:
Add Perplexity to this app with Stripe Projects, then build a /research endpoint that calls the Agent API with the low preset.

Next steps

Agent API quickstart

Presets, tools, and the full Agent API surface for your first build.

Search API quickstart

Ranked, real-time web results as structured data.

Pricing

What credits buy across models, tools, and APIs.