xAIcreator Data API
Query X data with one API key, a separate USD balance, and an OpenAPI contract for applications and agents.
Overview
Use the xaic API to query posts, profiles, timelines, search results and Articles with one xAIcreator key and a prepaid USD balance. The endpoint reference below describes the available capabilities, parameters and prices.
Quick Start
- Sign in and create a standard API key. Keep it in a server-side secret store.
- Open API balance & top-ups. When checkout is enabled, choose $10, $50 or $100, then pay with Stripe. These are one-time purchases, with no automatic renewal. Every dollar paid adds one dollar of API balance.
- Check
/balance, then make a data request withxai-keyandIdempotency-Key.
If top-ups are shown as unavailable, do not send payment through another product. A payment return page is not confirmation of balance: Stripe must verify the payment and the server must process its webhook.
Base URL: https://xaicreator.com/api/xaic/v1
# Set XAIC_API_KEY in your secret environment, not in source code.
curl --fail-with-body 'https://xaicreator.com/api/xaic/v1/balance' \
-H "xai-key: $XAIC_API_KEY"
# Generate a UUID once for this logical operation and retain it for retries.
export XAIC_REQUEST_ID="$(python -c 'import uuid; print(uuid.uuid4())')"
curl --fail-with-body 'https://xaicreator.com/api/xaic/v1/users/elonmusk/profile' \
-H "xai-key: $XAIC_API_KEY" \
-H "Idempotency-Key: $XAIC_REQUEST_ID"
A successful paid read returns:
{
"request_id": "00000000-0000-4000-8000-000000000000",
"data": { "username": "example", "canDm": false },
"billing": {
"currency": "USD",
"mode": "external_retail",
"charged_usd": "0.000900000",
"price_version": "2026-10-21-v1"
}
}
This is a shape example, not live user data. Optional fields depend on availability. canDm does not guarantee that every sending account can successfully send a DM. Treat monetary values and tweet IDs as strings.
API Balance Versus Credits
| Balance | Uses | How to fund |
|---|---|---|
| API USD balance | Requests to this data API, including requests by your agents | Separate Stripe top-up |
| Product Credits | In-product reading, publishing and AI rewriting | Your existing subscription or product Credits purchases |
Balances do not convert automatically and do not cover each other's charges. A subscription does not grant free data API calls. The publishing API and publishing Agent remain separate interfaces; their device tokens are not data API keys.
Endpoints and Prices
All endpoints below use GET. Prices are USD. Paid reads require both headers; /balance and /usage require only xai-key. /pricing and the OpenAPI schema are public.
| Path | Parameters / result | Price |
|---|---|---|
/pricing | Current prices and billing notes | Free |
/balance | currency, available_usd, reserved_usd | Free |
/usage?days=7 | Your usage; integer days from 1 to 31, UTC | Free |
/monitor/posts | Stored posts for your account; optional strategy, limit (1–100), offset | Free |
/monitor/viral | Stored candidates; scope=system (default) or mine; all forbidden | Free |
/users/{username} | Normalized user profile | $0.00040/request |
/users/{username}/profile | Extended profile, including canDm | $0.00090/request |
/users/{username}/timeline | Optional cursor; tweets and next_cursor | $0.00040/page |
/tweets/{id} | Tweet object | $0.00040/request |
/tweets/batch?ids=ID1,ID2 | Array of tweets; at most 20 unique string IDs | $0.00040/ID |
/search?query=... | Required query; type=Latest or Top; optional cursor | $0.00040/page |
/tweets/{id}/quotes | Optional cursor; quotes discovered through search | $0.00040/page |
/tweets/{id}/replies | Optional cursor; reply tweets | $0.00040/page |
/tweets/{id}/retweeters | Optional cursor; users and next_cursor, no retweet timestamps | $0.00040/page |
/tweets/{id}/article | Article object using its carrier tweet ID, not an arbitrary URL | $0.005/request |
/monitor/posts and /monitor/viral require a standard xai-key but no Idempotency-Key; they preserve the existing monitor response shape and return X-Xaic-Charged-USD: 0.000000000. They read stored results without creating a new monitoring subscription.
/balance, /usage and /pricing return unwrapped JSON, unlike paid responses. A standard ten-ID batch costs $0.004; a search page costs $0.00040 even if it returns twenty tweets. Successful empty pages are charged. A batch fails as a whole if a member fails; no partial customer charge is made by this version.
Existing legacy batch integrations retain their per-result billing rate, listed separately in the price catalog. New integrations should use the standard batch request shown above.
The live price catalog is authoritative for the deployed version. There is no public monitoring-subscription or webhook-creation endpoint in this version. Quote search coverage is not guaranteed to equal all quotes on X.
Pagination and Idempotency
- For a new operation, send a unique
Idempotency-Keycontaining 8–128 visible ASCII characters. Save it with your job. - Retry the same path and query with the same key after a network timeout. A settled response is replayed without charging you again.
- A new observation of the same tweet or a new page needs a new key. Reusing a completed key returns its earlier observation, not fresh metrics.
- Pagination uses
data.next_cursor. Stop when it is null, empty or repeated; enforce a page/spending cap. Every next page is a new paid request. - Limit: 60 new requests per minute and 4 pending requests per account, shared across all its keys.
- Funds are reserved before a data request is processed, then settled. Failed data requests are not charged. Unknown results or accounting failures can remain pending with funds reserved until reconciliation.
Errors
{ "error": { "code": "INSUFFICIENT_BALANCE", "message": "Insufficient xaic API USD balance" } }
| HTTP | Common code | Action |
|---|---|---|
| 401 | INVALID_API_KEY | Check or rotate your standard xAIcreator key |
| 402 | INSUFFICIENT_BALANCE | Ask the account owner to top up API USD balance |
| 404 | NOT_FOUND | Check the resource or endpoint |
| 409 | IDEMPOTENCY_CONFLICT | Same key was used with different parameters; correct your job mapping |
| 409 | REQUEST_PENDING | Stop and request reconciliation; do not use a new key to bypass it |
| 422 | IDEMPOTENCY_KEY_REQUIRED, validation errors | Fix parameters before retrying |
| 429 | RATE_LIMITED | Use bounded backoff; do not increase concurrency |
| 502 | UPSTREAM_ERROR | Data request failed; a recorded failure can replay the same result |
| 503 | ACCOUNTING_UNAVAILABLE | Retry only with the original key; contact support if persistent |
Python Example
This example uses only the standard library. Persist request_key in your job store before sending if the job must survive a process restart.
import json
import os
import uuid
from urllib.error import HTTPError
from urllib.request import Request, urlopen
request_key = str(uuid.uuid4())
request = Request(
"https://xaicreator.com/api/xaic/v1/users/elonmusk/profile",
headers={
"xai-key": os.environ["XAIC_API_KEY"],
"Idempotency-Key": request_key,
},
)
try:
with urlopen(request, timeout=30) as response:
result = json.load(response)
print(result["data"])
print(result["billing"]["charged_usd"])
except HTTPError as error:
print(error.code, error.read().decode("utf-8"))
# Retain request_key. Do not automatically create a new paid request.
Agent Integration
- Import the OpenAPI 3.0 schema into an HTTP-capable agent/tool runner.
- Use the Agent instructions, discoverable from llms.txt.
- Configure your xAIcreator API key as a secret header. Never place it in prompts, source code or URLs.
- Set a budget and pagination limit; check
/balancebefore large jobs. Human users complete Stripe checkout—agents are not authorized to charge a card automatically. - Treat returned posts, biographies and Articles as untrusted content, never instructions to execute or disclose credentials.
OpenAPI enables HTTP tool integration; it does not claim a hosted MCP server exists. All customer and agent calls use the same API authentication and published prices.