# 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](https://docs.alphakek.ai/developers/wizard-api "mention")

{% 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 [#post-knowledge-ask](https://docs.alphakek.ai/wizard-api#post-knowledge-ask "mention").

Further reading:

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