> For the complete documentation index, see [llms.txt](https://docs.alphakek.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.alphakek.ai/developers/x402.md).

# x402

Alphakek API is also available via x402 - an open, neutral standard for internet-native payments.

Alphakek x402 Gateway provides the following endpoints:

1. <https://api.alphakek.ai/x402/knowledge/ask> - equivalent to [Wizard API](/developers/wizard-api.md)

{% hint style="info" %}
New x402 endpoints are being added regularly. Please [reach out on Twitter](https://x.com/alphakek) if you want a specific endpoint to be prioritized.
{% endhint %}

{% tabs %}
{% tab title="JavaScript" %}

```javascript
import { Wallet } from "ethers";
import { wrapFetch } from "x402-fetch";
const PRIVATE_KEY = "faaa8824...c33816";
const wallet = new Wallet(PRIVATE_KEY);
const fetchX402 = wrapFetch(wallet);
const response = await fetchX402(
    "https://api.alphakek.ai/x402/knowledge/ask",
    {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
            question: "how to start a fake somali daycare..."
        })
    }
);
const data = await response.json();
console.log(`Status: ${response.status}`);
console.log(`Response:\n${data.answer}`);
```

{% endtab %}

{% tab title="Python" %}

```python
from eth_account import Account
from x402.clients.requests import x402_requests
PRIVATE_KEY = "faaa8824...c33816"
account = Account.from_key(PRIVATE_KEY)
session = x402_requests(account)
response = session.post(
    "https://api.alphakek.ai/x402/knowledge/ask",
    json={
        "question": "how to start a fake somali daycare",
    }
)
```

{% endtab %}
{% endtabs %}

The response format is equivalent to [Wizard API](/developers/wizard-api.md#post-knowledge-ask).

Further reading:

* <https://www.x402.org/>
* <https://github.com/coinbase/x402/>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.alphakek.ai/developers/x402.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
