---
title: "Create Token"
method: POST
path: "/api/v1/tokens"
---

# Create Token

`POST /api/v1/tokens`

Create a `kya`, `pay`, or `kya-pay` token as a buyer agent.

## Request body

- object
  - `type` string, required — One of `kya`, `pay`, or `kya-pay`. The created token will contain JWT header `typ` set to `<type>+jwt`.
  - `buyerTag` string — Buyer’s internal identifier for the token. e.g. "research-agent-xyz"
  - `tokenAmount` string — The amount of funds in currency units allocated to the token. Determines the maximum amount the seller can charge. Must include if this is a `pay`or `kya-pay` token. For successful token creation, this value must be: - Greater than 0 - Less than or equal to the buyer agent wallet balance - Greater than or equal to the seller service minimum token amount (if applicable) If these conditions are not met, the token creation request will fail.
  - `sellerServiceId` string — ID of an onboarded seller service. Obtain this from the Skyfire Directory. Required when creating a token for an onboarded seller.
  - `sellerDomainOrUrl` string — Domain name or full URL of an external seller. The buyer agent must belong to an organization and authenticate using an Organization Buyer API Key. Required when creating a token for an external seller.
  - `expiresAt` integer — Unix timestamp (seconds) representing when the token expires. Provide an absolute epoch time, not a relative duration. If omitted, defaults to the maximum allowed lifetimes: * 24 hours from now when using `sellerServiceId` * 5 minutes from now when using `sellerDomainOrUrl` Must be between 10s and the maximum allowed lifetime for the selected target type.
  - `identityPermissions` string[] — Default: empty array. Can be specified if this is a `kya` or `kya-pay` token. Additional identity fields to include in the token. See https://docs.skyfire.xyz/reference/identity-fields for more info.

## Response `200`

200

- object
  - `token` string

## Other responses

- `401` — 401
- `402` — 402
- `422` — 422

---

[API](https://skmtc.net/skyfire/apis/skyfire-agent-and-token-apis.md) · [All operations](https://skmtc.net/skyfire/apis/skyfire-agent-and-token-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/skyfire/skyfire-agent-and-token-apis/versions/209ba8f90d59/schema)
