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 data-only API key. Keep it in a server-side secret store. New keys use the
xaic_data_prefix anddata.readscope; they cannot publish or manage accounts. - Open API balance & top-ups. Choose $10, $50 or $100, or enter a custom amount from $10–$10,000, then pay with Stripe.
- 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. A separate 60-work-unit per minute cap counts each unique ID in a batch. Repeated failures can trigger protective limits; never bypass them with another key or idempotency key.
- Default per-key limits are $25 daily, $100 lifetime and 90 days, adjustable in the console. Daily limits reset at UTC midnight. Pending reservations count toward budgets, and edits do not reset lifetime usage. Set either budget to zero to pause new paid calls.
- Existing keys remain usable after the security migration, subject to budgets and expiry. Restricting a legacy key to
data.readpermanently removes its publishing permissions. Full secrets are shown only at creation; the server stores hashes. Review in-app security alerts on the keys page. - Payment disputes, debt or pending verification may pause new paid requests. Paid funds exceeding wallet capacity are retained as pending credit, shown in the console and applied automatically when capacity becomes available.
- 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, WORK_RATE_LIMITED | Use bounded backoff; do not increase concurrency |
| 429 | KEY_DAILY_BUDGET_EXCEEDED, KEY_TOTAL_BUDGET_EXCEEDED | Stop; ask the owner to review budgets, or wait for the next UTC day for daily limits |
| 429 | FAILURE_RATE_LIMITED, FAILURE_BUDGET_EXCEEDED, GLOBAL_FAILURE_BUDGET_EXCEEDED | Pause retries and review the integration; do not bypass protection with another key or account |
| 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.