Skip to content

Quickstart

This page takes you from zero to your first API call: create an API account, generate a key, and call an endpoint with it. Everything happens on the website plus one terminal — about five minutes end to end.

  • An OhMy.xin account you can sign in with (signing in with Mixin is enough).
  • A terminal or tool that can send HTTP requests — the examples below use curl and can be copied as-is.

Sign in to OhMy.xin on the web, click your avatar in the top-right corner to open the menu, and choose Developer API.

Click New API account, fill in a name (required) and an optional description, and submit. You land on the account page, which shows the account number, its state, and the current rate limit.

Use API accounts to isolate integrations or environments — one for production, one for testing, for example. The default ceiling is 5 accounts per user, counted across all of your accounts including disabled ones. Retire an account you no longer need by disabling it on its page — disabling turns off its keys but does not free up a slot.

On the account page, find API keys, click Generate key, and give it a name (say, “Primary key”).

From then on the key list shows only the name, prefix, and a masked tail — never the full secret again. Each account allows up to 10 active keys by default, on purpose: it lets you run an old and a new key side by side and rotate without downtime (see below).

Start with the health check, which needs no key:

终端窗口
curl -s https://ohmy.xin/api/v1/health

Then the credential self-check with your key (replace omx_live_… with the full key you saved):

终端窗口
curl -s https://ohmy.xin/api/v1/me \
-H "Authorization: Bearer omx_live_xxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"

A successful call returns JSON in the shared envelope with your account and key details:

{
"data": {
"account": {
"number": "8392014",
"name": "Production Integration",
"state": "active",
"rate_limit_per_minute": 60
},
"key": {
"name": "Primary Key",
"masked_token": "omx_live_a1b2c3d4••••••••x9y0",
"state": "active",
"last_used_at": "2026-11-15T22:14:12+08:00"
}
},
"meta": {
"request_id": "9f4f2d1e-7c3b-4c68-9f9f-0a1b2c3d4e5f"
}
}

The two built-in endpoints confirm the plumbing. To pull actual data, call one of the business endpoints — they share the same auth, rate limiting, and pagination:

终端窗口
curl -s "https://ohmy.xin/api/v1/strategies?limit=2" \
-H "Authorization: Bearer omx_live_xxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
终端窗口
curl -s "https://ohmy.xin/api/v1/lives?limit=2" \
-H "Authorization: Bearer omx_live_xxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"

Both return data as an array plus a meta.pagination block. When meta.pagination.has_more is true, pass meta.pagination.next_cursor back as the cursor parameter to fetch the next page. See the strategies reference and the lives reference for every filter and field.

Back on the Developer API page, open the account and scroll to Recent calls: every request is listed with its time, endpoint, status code, outcome, duration, and source IP, filterable by key, time range, endpoint, and outcome, with success/failure totals at the top.

Records are collected asynchronously, so they appear shortly after the request itself; requests rejected outright by the IP-level bucket never make it into the log. Details are kept for 90 days by default.

Keys are built for no-downtime rotation:

  1. Generate a new key under the same account;
  2. Swap the key in your integration and confirm calls succeed;
  3. Revoke the old key — its very next request is rejected.

If a key leaks, don’t wait for a rotation window: disable it (re-enable later if needed) or revoke it (permanent) — the change takes effect immediately.

Symptom Cause and fix
401 unauthorized Credentials missing, the key copied incompletely or wrongly, the key disabled/revoked, or its account disabled/frozen. For safety reasons the platform does not say which — first check that the key was copied in full and its state is “active”.
429 rate_limit_exceeded Rate limit hit. The Retry-After response header says how long to wait; accounts default to 60 requests per minute.
404 not_found Unknown endpoint. The open endpoints are /api/v1/health, /api/v1/me, /api/v1/strategies, and /api/v1/lives — see the API reference.
400 invalid_parameter A query parameter is invalid. error.details names the offending parameter; see the endpoint page for the accepted values.
No X-RateLimit-* headers Two possibilities: the Authorization header is malformed (auth never succeeded), or the request was rejected by the IP-level fallback bucket — the latter’s message is “Too many requests. Please retry later.”. Tell them apart by the response message.