# Create an agent checkout link (QuantSet API)

> Create a checkout link for a personal key. Share the link with the account owner for payment.

> ## For AI agents
> The QuantSet API is at https://api.quantset.dev. Send the key in the `X-API-Key` header. The sandbox key `mw_demo` needs no signup and reads the sample listings.
> No key yet? An agent can open an account on its own: https://api.quantset.dev/skill.md
> Connect an MCP client to https://api.quantset.dev/mcp. Client setup is at https://api.quantset.dev/agents.md.
> Start with https://api.quantset.dev/llms.txt or read the full reference at https://api.quantset.dev/llms-full.txt. The OpenAPI file is https://api.quantset.dev/openapi.json. Add `.md` to any docs URL to get that page as Markdown.

`POST https://api.quantset.dev/api/v1/agent/checkout-link` · `create_agent_checkout_link`

Send a key in the `X-API-Key` header.
Returns JSON.
Price: Free. It uses no credits.

## Workflow examples

### How does an agent hand a credit purchase to its account owner?

```http
POST https://api.quantset.dev/api/v1/agent/checkout-link
Content-Type: application/json

{
  "plan": "credits"
}
```

Use the account’s authenticated key and request the credits plan. Give checkout_url to the owner and check the returned plan and mode.

## Reading the results

The response creates a handoff for payment. The existence of a URL does not show that payment completed or that credits were added.


## Coverage and limits

After checkout, verify account access with the original key. A shared sandbox key cannot identify an account for billing.


## Parameters


## Response fields

- `checkout_url` (string): A link.
- `plan` (credits | growth | scale | developer | pro | commercial | developer_annual | pro_annual | commercial_annual)
- `amount_usd` (integer): In US dollars.
- `included_credits` (integer)
- `mode` (stripe | console)
- `message` (string)

## Example

```
curl -X POST 'https://api.quantset.dev/api/v1/agent/checkout-link' -H 'X-API-Key: YOUR_API_KEY' -H 'Content-Type: application/json' --data '{"plan":"credits"}'
```

## Responses

- 200 Successful Response
- 400 Supply one credential.
- 401 Supply a valid API key.
- 403 Your key does not have the required access.
- 413 Reduce the size of the request body.
- 422 Correct the named parameter and retry.
- 429 Wait for Retry-After seconds.
- 500 The request could not be completed.

## Questions

**Can an AI agent use this?** Yes. An agent calls it over HTTP like any client. Add .md to this page's address for a version written for agents.

**What does null mean in the response?** The value could not be confirmed. It is never a zero, so treat it as missing in your own calculations.

Group: Account and integration
Docs page: https://quantset.dev/docs/api/agent-checkout-link-post
Integrations & Ecosystem: https://quantset.dev/integrations (Claude/Cursor MCP, LangGraph, PydanticAI, CrewAI, Agno, Vercel AI SDK, Mastra, Sheets =QUANTSET(), Excel, Notion & x402)
Full API guide: https://api.quantset.dev/llms-full.txt
