> For the complete documentation index, see [llms.txt](https://docs.otherside.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherside.xyz/odk-docs/otherside-agentic-api.md).

# Otherside Agentic API

This guide is for integrators who want to call Otherside Agent APIs from bots, backend services, or automation scripts.

## Base URL

* `https://otherside.xyz`

All endpoints below are relative to this base URL.

## What These APIs Do

* `GET /api/agents/privy-id`: map a wallet address to a Privy ID segment.
* `GET /api/agents/user-data`: read a user's location payload.
* `GET /api/agents/chat`: read text chat for a world.

## Pricing

* `GET /api/agents/privy-id`: `0.10` USDC.e
* `GET /api/agents/user-data`: `0.001` USDC.e
* `GET /api/agents/chat`: `0.001` USDC.e

## Payment Model (x402)

#### <mark style="color:$success;">NOTE: APIs are currently open and free during the developer preview period. No x402 handshake is required.</mark>

These endpoints use x402 challenge-response:

{% stepper %}
{% step %}
Call the endpoint normally (no payment header).
{% endstep %}

{% step %}
Receive `402` with `PAYMENT-REQUIRED`.
{% endstep %}

{% step %}
Build/sign payment payload from challenge requirements.
{% endstep %}

{% step %}
Retry same request with `PAYMENT-SIGNATURE` header.
{% endstep %}

{% step %}
On success, read `PAYMENT-RESPONSE` header for settlement details.
{% endstep %}
{% endstepper %}

## Chat World Targeting

For chat endpoints, callers can provide either:

* `worldId` (direct world identifier), or
* `world` (friendly alias label like `SWAMP` or `NEXUS`)

The API resolves world aliases server-side.

## Suggested Integration Flow

For "wallet to world chat" flows, use:

{% stepper %}
{% step %}
`GET /api/agents/privy-id?wallet=...`
{% endstep %}

{% step %}
`GET /api/agents/user-data?userId=...`
{% endstep %}

{% step %}
`GET /api/agents/chat`
{% endstep %}
{% endstepper %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otherside.xyz/odk-docs/otherside-agentic-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
