Skip to content
On this page

Start here

Build with an AI assistant

Let an AI coding assistant add Cycle to your app: it connects your account with a code, creates your plans, adds checkout, webhooks and the customer portal, and tests every case in test mode.

How it works

  1. Install. One line adds the Cycle skill to Claude Code. Other assistants (Cursor, Codex, Windsurf, GitHub Copilot) read the same instructions from the plain-text guide.
  2. Ask. Tell it: "Add Cycle subscriptions to my app." Any language, any framework: the API is plain HTTPS, with no library to install.
  3. Allow. It opens Cycle in your browser with a short code. Check the code matches the one in your terminal and press Allow. It gets a test-mode key for the business you pick.

Install the skill for Claude Code

Run this in a terminal on macOS, Linux or WSL. It puts the skill in ~/.claude/skills/cycle:

Terminal

mkdir -p ~/.claude/skills && curl -fsSL https://cycle.am/ai/cycle-skill.zip -o /tmp/cycle-skill.zip && unzip -oq /tmp/cycle-skill.zip -d ~/.claude/skills && rm /tmp/cycle-skill.zip

Then start Claude Code in your project and ask it to add Cycle. For any other assistant, give it this link: https://cycle.am/ai/guide.md.

What it builds

  • Your plans: products and prices in AMD, USD or EUR, monthly or yearly, with an optional free trial.
  • A Subscribe button that opens a checkout session. The card is typed on the bank's page, never in your app.
  • Webhooks that keep access in step with payments: checkout completed, renewals, failed payments, recoveries and cancellations, each signature checked.
  • "Manage subscription": a link to the customer portal, where customers change their card, switch plan or cancel.
  • A test run of every case in test mode: a paid checkout, a declined card, a trial, a renewal, a failed renewal and its recovery, a cancellation and a forged webhook.

It asks, it doesn't guess

Business rules stay yours. The assistant asks, suggests a default and writes your answer down:

QuestionSuggested answer
Your plans: names, prices, currency, period and trial?What you sell today.
When a renewal fails, Cycle retries the card for about 9 days. Does the customer keep access meanwhile?Keep access and show a notice asking them to update their card.
When the last retry fails, Cycle cancels the subscription. What then?End access.
Customers cancel in the portal and keep what they paid for until the period ends. Is that right?Keep access until the period ends.

Safe by design

  • Test mode only. The assistant gets a sk_test_… key. Real payments start only after you connect your bank and go live in the dashboard, which an assistant can't do.
  • The secret key stays on your server, in a git-ignored environment file: never in the browser or in git.
  • No card form in your app. Customers type their card on their bank's page.
  • You can disconnect it any time: see below.

Connect with a code

The flow the skill uses, for anyone building their own tool. No key is needed: the device_code is the app's secret.

  1. POST /api/v1/connect with {"client_name": "My tool"}. You get device_code, user_code, verification_url_complete, interval and expires_in (10 minutes).
  2. Show the user_code and open verification_url_complete in the person's browser. They sign in, pick a business, check the code and press Allow or Deny.
  3. Every interval seconds, POST /api/v1/connect/token with {"device_code": "…"}. Until they decide you get 400 with error: authorization_pending (or slow_down if you poll too fast). After Allow, one 200 with secret_key (test mode), business and api_base. After Deny: access_denied; when the time is up: expired_token.

cURL

curl -X POST https://cycle.am/api/v1/connect -H "Content-Type: application/json" -d '{"client_name": "My tool"}'

curl -X POST https://cycle.am/api/v1/connect/token -H "Content-Type: application/json" -d '{"device_code": "cdc_…"}'
The key is returned once. Store it in a git-ignored environment file on the server.

Disconnect an assistant

Under Developers → Build with AI → Connected apps you see every app you allowed, who allowed it and when it was last used. Disconnect revokes its key at once. Its keys are also listed under Keys & webhooks.