Skip to main content
Alguna publishes an official client library for TypeScript, Python, Go and Rust, and the alguna command-line tool. All five are generated from the same versioned OpenAPI spec as the API reference, so every endpoint has a method or a command, and they read and write the same objects the dashboard does: customers, products and prices, quotes, subscriptions and their versions, usage, invoices, payments and revenue schedules. Those objects all read from one versioned agreement per customer, which How Alguna works explains. Use this page to choose a client, connect it, and make a first call. The reference pages hold the full method lists and the details of each library.

Which one

The API key is a secret, so use the libraries and the CLI on a server, in CI, or on your own machine, never in a browser. For a purchase flow in your product’s frontend, use Embedded Checkout, where your server mints the session and the browser only mounts it.

Install

Create an API key in the dashboard under Settings → Connections → Developers → API keys. Every library and the CLI read it from ALGUNA_API_KEY when you do not pass it in code.

Connect

Pin the API version you integrate against. The date in Alguna-Version is what fixes the request and response shapes, and a later package release keeps sending the date you set. See Versioning.

A first call

Create a customer. Each reference page continues from here to a product, a subscription, an invoice and a customer portal session.

What every library does for you

  • Sends the Authorization and Alguna-Version headers on every request.
  • Sends an Idempotency-Key on every write, yours or a generated one, and reuses it on each retry, so a retried create never duplicates a record. See Idempotency.
  • Retries 408, 429, 502, 503 and 504, a 409 with Retry-After, and network failures, twice by default. Never retries a 500, because the request may have changed data. See Errors.
  • Raises a typed error for a failed response, carrying the HTTP status and the X-Request-Id. Include that id when you report a problem.

Sandbox first

Every library and the CLI take a base URL. Point it at https://api.sandbox.alguna.io with a sandbox API key, run the whole flow there, then switch the URL and the key for production. Sandbox and production are separate environments with separate keys and data. See Testing and Sandbox. For the CLI, set ALGUNA_BASE_URL=https://api.sandbox.alguna.io.

Reference

TypeScript

@alguna/sdk on npm: client options, the quick start, errors, pagination and webhooks.

Python

alguna on PyPI: sync and async clients, typed models and errors.

Go

github.com/alguna-io/alguna-go: options, pointers for optional fields, errors.

Rust

alguna on crates.io: the client builder, async calls, errors.

CLI

Log in, run commands, output formats, idempotency, timeouts and exit codes.

SDKs overview

Packages, source repositories, and how package and API versions relate.

MCP server

Connect Claude, ChatGPT, Cursor or any MCP client to your account.

Developer quick start

From an API key to a metered, invoiced subscription.