# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
