We also recommend a consistent way of informing callers when they do not include the required KYAPay
token in their requests.
- When a KYAPay token is missing
- Return an HTTP
402
Status Code - In the body include a message on how to create these tokens e.g.
ERROR: Missing KYAPay token in the skyfire-pay-id header. Please create an account at https://app.skyfire.xyz and create a kya | pay | kya+pay token - https://docs.skyfire.xyz/reference/create-token and include it in your request in the skyfire-pay-id header.
- Return an HTTP
- When a KYAPay token is invalid
- Return an HTTP
402
Status Code - In the body include a message on how to create these tokens e.g.
ERROR: Missing KYAPay token in the skyfire-pay-id header. Please create an account at https://app.skyfire.xyz and create a kya | pay | kya+pay token - https://docs.skyfire.xyz/reference/create-token and include it in your request in the skyfire-pay-id header.
- Return an HTTP
- Specifically when a pay token is missing
- Return an HTTP
402
Status Code - In the body include a message on how to create these tokens e.g.
ERROR: Missing pay token in the skyfire-pay-id header. Please create an account at https://app.skyfire.xyz and create a pay token - https://docs.skyfire.xyz/reference/create-token and include it in your request in the skyfire-pay-id header. The required amount is ...
- Return an HTTP
- Specifically when a pay token is depleted
- Return an HTTP
402
Status Code - In the body include a message e.g.
ERROR: The given pay token is depleted. Please create and send a new pay token. The required amount is ...
- Return an HTTP
Formatting
- If you believe the caller to be a Web Scraper, you may prefer to return the above messages in plain text
- If you believe the caller to be an LLM, you may prefer to return the above messages in a structured JSON format e.g. https://modelcontextprotocol.io/specification/2025-06-18/server/tools#error-handling
llms.txt
- We also recommend adding an llms.txt file to your website that includes an explanation of your use of
KYAPay
tokens.