# Calling operations (https://upapi.io/docs/api) Every operation is called the same way. Learn the shape once and the whole catalog is reachable — there is no per-operation base URL, no per-operation auth scheme and no per-operation response envelope to special-case. ```bash curl -X POST https://api.upapi.io/{slug} \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'content-type: application/json' \ -d '{ … }' ``` ```ts const res = await fetch('https://api.upapi.io/{slug}', { method: 'POST', headers: { 'x-api-key': process.env.UPAPI_API_KEY, 'content-type': 'application/json', }, body: JSON.stringify({}), }); const data = await res.json(); ``` ```python import os, requests res = requests.post( 'https://api.upapi.io/{slug}', headers={ 'x-api-key': os.environ['UPAPI_API_KEY'], 'content-type': 'application/json', }, json={}, ) data = res.json() ``` * **The slug is the path.** It is the callable form shown in the marketplace, which is not always identical to the operation's internal id — see [Quickstart](https://upapi.io/docs/quickstart#3-make-a-call). * **The body is the input.** It is validated against the operation's schema; a mismatch is `400 INVALID_INPUT` and names the offending field. * **A success returns the output object directly**, with no wrapper. Failures use the [standard error envelope](https://upapi.io/docs/errors). That uniformity is the point of the marketplace. Swapping one operation for another means changing the slug and the body — not rewriting your client. ## Try it [#try-it] Pick an operation and send the request from here. The call goes straight from your browser to `api.upapi.io` — nothing is proxied through this site — so it runs against your own account and spends your own units, exactly as the same request would from your code. _(An interactive request builder is embedded here on the web page: pick an operation, paste an API key, and it POSTs to `https://api.upapi.io/{slug}` from the browser. The equivalent request is shown above.)_ These are live operations, not a sandbox. A call that succeeds has genuinely scraped, fetched or posted something, and it is billed at the unit weight shown next to the operation. ## Idempotency [#idempotency] An operation is a POST that does real work upstream — a comment posted, an account created — and every accepted call spends units. So a request that times out leaves you with a genuine question: did it happen? Send an `Idempotency-Key` and the answer stops mattering. ```bash curl -X POST https://api.upapi.io/{slug} \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'idempotency-key: 8f14e45f-ea0f-4a2b-9d5a-5c4f2a1b7c30' \ -H 'content-type: application/json' \ -d '{ … }' ``` ```ts await fetch('https://api.upapi.io/{slug}', { method: 'POST', headers: { 'x-api-key': process.env.UPAPI_API_KEY, 'idempotency-key': crypto.randomUUID(), 'content-type': 'application/json', }, body: JSON.stringify({}), }); ``` ```python import os, uuid, requests requests.post( 'https://api.upapi.io/{slug}', headers={ 'x-api-key': os.environ['UPAPI_API_KEY'], 'idempotency-key': str(uuid.uuid4()), 'content-type': 'application/json', }, json={}, ) ``` The first request with a given key runs normally. Any later request with the **same key and the same body** replays the first one's stored response, with `Idempotency-Replayed: true`. Nothing runs again and nothing is billed again. * **Format** — any string of 36–255 characters. A UUID is ideal. A key outside that range is `400 INVALID_INPUT`. * **Scope** — your organization, for **24 hours**. After that the key is forgotten and reusing it starts a new request. * **The body is part of the identity.** Reusing a key with a different slug or a different body is `409 IDEMPOTENCY_KEY_REUSED`, and nothing runs — silently replaying the first answer would be answering a question you did not ask. The raw bytes are compared, so re-serializing the same JSON differently counts as a different request. * **A key whose first request is still running** answers `409 IDEMPOTENCY_IN_FLIGHT` with `Retry-After: 1`. Retry and you will get the stored response. A replayed response carries no quota headers — nothing was consumed, so there is no new position to report. Use [`GET /usage`](https://upapi.io/docs/usage-api) to read quota without spending. A `429` or a `5xx` releases the key instead of storing it: those say "this did not settle", and storing one would lock you out of the very retry `Retry-After` invited. Responses larger than \~100 KB are also not stored — a repeat of that key runs as a fresh request, and bills as one. Operations whose response is a live session are never replayable either: the login operations (`wellfound-login`, `chatous-login`) and the Wellfound reads that return a refreshed session blob. upAPI does not keep that response in the ledger. The key still stops a duplicate that arrives while the first call is running, with `409 IDEMPOTENCY_IN_FLIGHT`. Once the call has finished, a repeat of the same key runs the operation again and bills again. The same applies to a newly deployed operation that has not yet declared its replay policy: it is treated as never replayable until it does. Two write operations, `wellfound-apply` and `wellfound-send-message`, are different, because for a write the replay is the point: it is what stops a retry from submitting the application or sending the message twice. They keep replaying, with one difference. Their response carries a refreshed Wellfound `session`, which is a live credential, so upAPI stores the response **without the `session` field**. A replay of such a call returns everything except the session and adds a header naming what was left out: ```http Idempotency-Replayed: true Idempotency-Redacted: session ``` The first call, the one that actually ran, returns the full response including the refreshed session. After a replay, keep using the session you already hold, and call `wellfound-login` again if Wellfound rejects it. The header is only present when a field was really removed, so a replay that has no `Idempotency-Redacted` header is complete. The [TypeScript SDK](https://upapi.io/docs/sdk#idempotency) sends a key on every call and reuses it across its own retries, so you get this without doing anything. ## Calling from a browser [#calling-from-a-browser] The gateway answers CORS preflights and allows any origin, so a browser can call it directly. `x-api-key`, `content-type`, `idempotency-key` and `x-proxy-url` are all accepted on a cross-origin request, and the quota headers, `Retry-After`, `x-request-id`, `Idempotency-Replayed` and `Idempotency-Redacted` are all readable from one. An API key in front-end code is a key you have published. Keep the call server-side, or proxy it through your own backend. The CORS support exists for playgrounds, internal tools and first-party dashboards where the key is already the user's own. ## Where each operation is documented [#where-each-operation-is-documented] This site teaches the pattern. The **marketplace** documents the operations: | Here | On the marketplace | | ----------------------------------------- | ------------------------------------------ | | The request shape, shared by everything | One operation's input and output schema | | Auth, errors, quotas, retries | Field descriptions, defaults and bounds | | The SDK, the MCP server, hosted functions | A worked example and a runnable playground | Each operation's page lives at `upapi.io/apis/{category}/{name}`, where `{name}` is the slug without its `.get` or `.post` suffix — so [`github-trending.get`](https://upapi.io/apis/developer-tools/github-trending) is at that URL, and every other slug follows the same rule. The page carries the full schema, code snippets in eight languages, and a try-it button that runs the real operation against your account. Note the host: browsing starts on the [marketplace index](https://upapi.io/marketplace), which lists operations by category and by search, and each listing links across to its detail page on the app. ## Machine-readable sources [#machine-readable-sources] If you would rather consume the catalog programmatically, these are served live from the running platform: * [`/api/catalog`](https://app.upapi.io/api/catalog) — every public operation with its input and output schemas, category and tags. * [`/api/openapi.json`](https://app.upapi.io/api/openapi.json) — the same catalog as an OpenAPI 3.0.3 document. * Each operation's marketplace page also offers its own OpenAPI slice and a Postman collection, for importing one operation rather than all of them. That document is also enough to generate a typed client in your own language, if the [TypeScript SDK](https://upapi.io/docs/sdk) is not what you want: {/* Deliberately not ``: this is a choice of code generator, not of request language, and a shared group whose items are a subset renders an empty panel for anyone who last picked cURL. */} ```bash title="TypeScript" npx openapi-typescript https://app.upapi.io/api/openapi.json -o upapi.d.ts ``` ```bash title="Python" openapi-python-client generate --url https://app.upapi.io/api/openapi.json ``` A generated client is a snapshot: it is only as current as the document you generated it from, so re-run the command after operations are added. The TypeScript SDK is versioned and published instead, which is the difference worth knowing about. These come from the live platform rather than from a build artifact, so they track the catalog far more closely than any page here. They are not instantaneous: the catalog is cached for 30 seconds and the OpenAPI document for an hour, and during an engine outage both fall back to a seeded mirror and say so with `degraded: true`. Treat that flag as "this may be stale" rather than ignoring it. ## Conventions across operations [#conventions-across-operations] **Timestamps** are ISO 8601 in UTC, usually on a `fetchedAt` field, recording when the upstream data was read rather than when your request arrived. On a cached response (`x-upapi-cache: HIT`) it is the original fetch time. **Optional inputs** have server-side defaults. Sending `{}` to an operation with no required fields is valid and uses all of them. **Proxy control** is a header — `x-proxy-url` works on any operation. Some operations *additionally* declare a `proxyUrl` input field; the operation's marketplace page shows whether it does. See [Proxies](https://upapi.io/docs/platform/proxies). **Cost** varies per operation. Each carries a unit weight that is charged against your monthly quota — see [Rate limits](https://upapi.io/docs/rate-limits). --- # Authentication (https://upapi.io/docs/authentication) Every machine call carries an API key in the `x-api-key` header. There is no OAuth flow, no bearer token and no signature to compute for the REST gateway. ```bash curl -X POST https://api.upapi.io/github-trending.get \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'content-type: application/json' \ -d '{}' ``` ```ts await fetch('https://api.upapi.io/github-trending.get', { method: 'POST', headers: { 'x-api-key': process.env.UPAPI_API_KEY, 'content-type': 'application/json', }, body: '{}', }); ``` ```python import os, requests requests.post( 'https://api.upapi.io/github-trending.get', headers={'x-api-key': os.environ['UPAPI_API_KEY']}, json={}, ) ``` The same header authenticates the [usage endpoint](https://upapi.io/docs/usage-api) and the [local MCP server](https://upapi.io/docs/mcp). ## Key format [#key-format] A key is the prefix `upapi_` followed by 48 hexadecimal characters — 54 characters in total. ``` upapi_YOUR_KEY_HERE ``` A real key has 48 hex characters after the prefix; the placeholder above is not one. The first 12 characters are kept in plain text so the dashboard can label a key in a list. Everything else exists only as a SHA-256 hash. A presented key is hashed and matched against that hash, which is why a lost key cannot be recovered — only replaced. ## Test-mode keys [#test-mode-keys] Pick **Test** when you create a key (or pass `mode: "test"` to `create_api_key`) to get a key that starts with `upapi_test_`. Use it while you wire up a no-code builder or write integration tests: * Every operation answers with a fixed sample built from that operation's documented response schema, so you get the real shape without real data. * Samples are flagged twice: the `x-upapi-test-mode: true` response header, and a top-level `test_mode: true` field in the body. * A test call never spends units, never reaches the upstream service and does not show up as usage. It still needs a valid key, still checks required fields, malformed JSON and proxy URLs (`400`), and is still rate-limited per minute. * The same input always returns the same sample. `screenshot.post` returns a 1×1 PNG and `html-to-pdf.post` a one-page PDF. With `output: "url"` you get a link to a static copy of that file. * A test key cannot use account tools (keys, billing, members). Switch to a live key for real results; nothing else in your calls has to change. ## Keys belong to the organization [#keys-belong-to-the-organization] A key is scoped to the organization that created it, not to the person. Two consequences worth designing around: * Every member with admin rights sees and manages the same set of keys, and a key keeps working when its creator leaves. * Usage and quota are pooled across all of an organization's keys. Ten keys do not give you ten quotas — see [Rate limits](https://upapi.io/docs/rate-limits). Keys carry no per-operation scoping today. A key can call every operation published to your organization. ## Limits [#limits] | | | | ------------------------ | -------------- | | Keys per organization | 20 | | New keys per hour | 10 | | Times a key is displayed | 1, at creation | ## Managing keys [#managing-keys] Keys are created and deleted by an organization admin: ask your agent to run `create_api_key` or `revoke_api_key`, or use the [API keys page](https://app.upapi.io/dashboard/api-keys). Both manage the same keys. Creating, listing and deleting keys happen through the dashboard only. If you are building provisioning automation, that is not available yet — do not plan around an endpoint that does not exist. Deleting a key removes it outright rather than flagging it as revoked. Calls presenting a deleted key fail immediately with `UNAUTHORIZED`. ## Connected platform accounts [#connected-platform-accounts] Some operations act as a signed-in account on another platform (TikTok, Instagram, LinkedIn, X, Reddit, Facebook). They take that account's session as an input: `sessionCookies`, or `auth_token` and `ct0` for X. When your workspace has a connected account for the platform, you can leave that input out and the gateway fills it from the stored session. This is for MCP sign-in and the dashboard only for now: an API key must still send the session itself. A stored session the platform rejects answers `401 AUTH_EXPIRED` with a `reconnect` hint and is not charged. How to connect an account, and every rule for using it, is on [Connect platform accounts](https://upapi.io/docs/connect-platforms). ## Failure modes [#failure-modes] | Situation | Status | Code | | ------------------------------------------------ | ------ | --------------------- | | No `x-api-key` header | 401 | `UNAUTHORIZED` | | Unknown or deleted key | 401 | `UNAUTHORIZED` | | Key is valid, action is not allowed on your plan | 403 | `FORBIDDEN` | | Our auth infrastructure is down | 503 | `SERVICE_UNAVAILABLE` | | A stored platform session was rejected | 401 | `AUTH_EXPIRED` | A 503 here means we could not check your key, not that your key is bad. Retry rather than rotating credentials — see [Errors](https://upapi.io/docs/errors). Key-authenticated callers get `SERVICE_UNAVAILABLE`; `AUTH_UNAVAILABLE` is the same outage seen from a session surface such as the dashboard or the hosted MCP endpoint. --- # Changelog (https://upapi.io/docs/changelog) What changed on the platform, newest first. Only changes you can observe as a caller: new operations, gateway behaviour, client releases, documentation surfaces. Per-operation detail lives on each marketplace listing. Subscribe with any feed reader: [upapi.io/docs/rss.xml](https://upapi.io/docs/rss.xml). ## Google Maps reviews _August 18, 2026_ - `google-maps-reviews.get` is live — place reviews with author, rating, full text, photo counts and both relative and ISO timestamps, with cursor pagination and four sort orders. Weight 6. - That completes the Maps category: search, place details and reviews. ## Docs at upapi.io/docs, Maps operations, MCP Registry listing _August 17, 2026_ - These docs are now served at `upapi.io/docs`. The old `docs.upapi.io` host redirects here permanently, so existing links keep working. - Agent-facing surface: `/docs/llms.txt`, `/docs/llms-full.txt`, and a Markdown twin of every page at `.md`. Each page also carries copy-as-Markdown and open-in-assistant actions. - The [calling operations](https://upapi.io/docs/api) page ships a live request builder — pick an operation, paste a key, and it calls `api.upapi.io` from the browser. - `google-maps-search.post` (weight 6) and `google-maps-place.get` (weight 4) are live. - The MCP server is listed in the public MCP Registry as `io.github.DevinoSolutions/upapi-mcp`. ## SDK and MCP server published to npm _August 16, 2026_ - `@upapi/sdk` and `@upapi/mcp` are on npm, published with build provenance attestations. - Both packages are open source, so the client that holds your API key can be read before you install it. ## File and browser operations, idempotency, MCP tool facade _August 14, 2026_ - Seven operations: `screenshot.post`, `html-to-pdf.post`, `fetch-markdown.post`, `pdf-extract-text.post`, `image-ocr.post`, `audio-transcribe.post` and `audio-transcribe-result.get`. - Operations that take a file accept base64 input or a presigned upload, and the docs and dashboard forms render a file picker for both. - `Idempotency-Key` is honoured on every gateway call: a replay returns the first response and re-executes nothing. - Rate-limit responses split by cause — `RATE_LIMITED` for the per-minute burst, `QUOTA_EXCEEDED` for the monthly and trial budgets — and every response carries IETF `RateLimit` headers alongside the legacy `X-RateLimit-*` ones. - The gateway answers cross-origin requests, so a browser can call it directly. - The MCP server defaults to a compact tool facade (`search_ops` plus `call_op`) instead of one tool per operation, and tokens carry scopes. ## Documentation rebuilt around the platform _August 8, 2026_ - The docs teach the platform — one request shape, one error envelope, one quota — instead of restating every operation. Per-operation reference lives on each marketplace listing. ## TypeScript SDK, MCP server and this documentation site _August 7, 2026_ - `@upapi/sdk`: a typed, zero-dependency client generated from the operation catalog. - `@upapi/mcp`: every public operation as an MCP tool, over stdio or a hosted endpoint at `app.upapi.io/api/mcp` with OAuth 2.1 and PKCE. - This documentation site. --- # Connect platform accounts (https://upapi.io/docs/connect-platforms) Some operations act as an account on another platform: following on TikTok, commenting on Reddit, reading a LinkedIn profile as a logged-in member. They need that account's login session. Your agent can walk you through handing upAPI the session once, so it is saved to your workspace instead of travelling in every request. ## Connect an account [#connect-an-account] Ask your agent: "Connect my TikTok account". It calls `connect_platform`, which returns a one-time link and the exact steps. 1. Open the link in the browser where you are signed in to upAPI. It works once and for 15 minutes. 2. On the page, open the platform's login (it opens in a new tab) and sign in to the account you want to connect. 3. In that tab, press F12, open **Network**, reload, click any request to the platform, and copy the value of the **Cookie** request header. The page lists the cookie names it needs. 4. Back on the upAPI page, paste it, type the account handle, tick the box accepting the risk warning, and press **Connect**. 5. Tell your agent you are done. It calls `check_platform_account` to confirm. The page opens with a **Connect at your own risk** warning, and **Connect** stays disabled until you tick the box accepting it: upAPI is not liable for a leaked session, a suspended account or other consequences of connecting, and you are responsible for the platform's terms. The details are in the [Privacy Policy](https://upapi.io/privacy#connected-platforms) and the [Terms](https://upapi.io/terms#connected-platforms). upAPI checks the session before saving it where the platform has a reliable check. If the platform rejects it, nothing is saved, an account you already connected stays as it was, and you can paste again with the same link. That check is a metered operation, so a rejected paste still uses units. ### Sign in in a live window [#sign-in-in-a-live-window] Where the live sign-in window is switched on for your workspace, steps 2 to 4 are replaced by a browser that upAPI runs for you, shown on the same page. You sign in to the platform inside it and tick the **Connect at your own risk** box. On every platform except Contra you also type the account handle in a field at the bottom, as before; Contra needs none, because its session check reports the account's id. upAPI notices when you are signed in and the page says "You're signed in to" and the platform's name, with a **Confirm and connect** button. If it has not noticed, **I've signed in** is there: upAPI tells you what is still missing if you press it too early, and then offers **Connect anyway**. Nothing is saved until you press a button. **Do it manually** opens the cookie steps above whenever you prefer them. On Contra the connection is named after that account id. If the check cannot return one, it is named `Contra account`, and signing in again refreshes the same connection. If your workspace already holds another active connection for the platform, the page says so and how to remove the old one; nothing is removed for you. Paste the cookies into that page only. Never paste them into the chat with your agent: a chat transcript is stored by your AI client, and the tools never ask for them. A browser extension that captures the session in one click is planned. Until it ships, copying the header by hand is the only way. ## Platforms [#platforms] | Platform | Can be connected | Session check | | --------- | ---------------- | ---------------------------------------------------------- | | TikTok | Yes | None that proves the session is alive: saved, not verified | | Instagram | Yes | Not callable yet: saved, not verified | | LinkedIn | Yes | Yes | | Reddit | Yes | Yes | | X | Yes | Needs a pinned proxy: saved, not verified | | Facebook | Yes | None that proves the session is alive: saved, not verified | | Contra | Yes | Unproven: the check has never run against a live account | | Wellfound | Not yet | Its session format has not been measured | Your agent sees the platforms it can connect in the `platform` choices of `connect_platform`, and asking for one that cannot be connected yet explains why. "Saved, not verified" means upAPI stored the session but has no reliable way to tell whether the platform still accepts it. ## Use the saved session [#use-the-saved-session] Once an account is connected you can call the operations that need it without the session field. Leave out `sessionCookies` (or `auth_token` and `ct0` for X) and the gateway fills them from the stored session for your workspace. This works through your MCP agent and the dashboard try-it page. It does not work for API keys yet: a key must still send the session itself. * **Your value wins.** If you send the field, the stored session is not touched. An empty string counts as left out. * **Only operations that cannot run without a session.** Public reads that take an optional session stay anonymous unless you send one. * **Nothing connected is an answer, not a dead end.** Calling one of these operations with no session and no connected account (or an expired one) answers `401 AUTH_EXPIRED` with "No account is connected" or "session has expired", free of charge. Your agent gets `next` pointing at `connect_platform`. * **One account per platform.** With several connected accounts for one platform the call is refused with `INVALID_INPUT` and the account names. Send the session yourself, or disconnect the others. * **It stays inside upAPI.** Platforms rotate cookies as you use them. upAPI keeps the new ones and removes them from the response, so the operation's answer never contains your session. A call that sent its own session gets that session's refreshed cookies back as before. Calls that used a saved session are never served from, or written to, the response cache. * **A rejected session is not charged, and not always expired.** If the platform rejects the saved session the call is free. The connection is marked expired, and the error carries `reconnect` (`{ platform, tool: "connect_platform", path }`), only when the platform's own check agrees the session is dead, or when it happens twice within 15 minutes. One rejection can also mean the exit address was blocked, so a single failure keeps the connection and returns the operation's own error. Contra's operations use the same lookup. Wellfound's are wired to it too, and start using it once Wellfound can be connected. ## What upAPI stores [#what-upapi-stores] * Only the cookies the platform needs. Everything else in your paste is dropped in your browser before anything is sent, and dropped again on the server. * The cookies are encrypted at rest. No tool and no page shows them again: a connected account is listed by platform, handle, status, the cookie **names** it holds, and timestamps. * Who connected it and when. Platforms often tie a session to the network and browser that created it. A session replayed from another address can be logged out by the platform. If an operation reports an expired session, run the connect steps again. ## Who can do what [#who-can-do-what] * Connecting and disconnecting need an OAuth sign-in with the **Connected services** permission and the admin or owner role. An API key is refused for both, so a leaked key cannot plant a session in your workspace or remove one. * Listing accounts shows the redacted view to any workspace member whose connection holds the permission. * Using a saved session in a call needs the **Connected services** permission on an MCP connection. API keys cannot use a saved session yet, and cannot connect or disconnect one either. * Checking an account needs the same role. It runs the platform's check operation once, metered like any operation. ## Disconnect [#disconnect] Ask your agent to disconnect the account. `disconnect_platform_account` asks for a confirmation, then deletes the stored session. To end the session on the platform too, log out of that platform everywhere. ## Tools [#tools] | Tool | What it does | | ----------------------------- | --------------------------------------------------------- | | `connect_platform` | Returns the one-time link and the steps. | | `list_platform_accounts` | Connected accounts: platform, handle, status, last check. | | `check_platform_account` | Re-checks one account and updates its status. | | `disconnect_platform_account` | Deletes the stored session. Needs a confirmation. | The full list of account tools is on [MCP tools](https://upapi.io/docs/mcp-tools). --- # Errors (https://upapi.io/docs/errors) Every failure — bad input, a missing operation, a rate limit, a dead upstream — comes back in the same shape: ```json { "error": { "code": "INVALID_INPUT", "message": "language: String must contain at most 30 character(s)" } } ``` `code` is a stable, machine-readable identifier: branch on it. `message` is written for a human reading a log and may change at any time, so do not parse it. For a marketplace operation the HTTP status matches the code, which means a classified failure reaches you as the status it deserves rather than a blanket 502. [Hosted functions](https://upapi.io/docs/platform/hosted-functions) are the exception, in both the status and the shape — see below. Every response, successful or not, also carries an `x-request-id` header. Quote it when reporting a problem — it is how we find your exact call. ## Codes [#codes] | Code | HTTP | Meaning | | --- | --- | --- | | `CALLER_PROXY_AUTH_REJECTED` | 400 | The proxy you supplied (proxyUrl or x-proxy-url) refused our connection with HTTP 407. Check its credentials and whether your provider allow-lists the connecting IP. Distinct from PROXY_UNAVAILABLE, which is about our own pool. | | `INVALID_INPUT` | 400 | The input failed the operation's schema validation. | | `INVALID_JSON` | 400 | The request body was not parseable JSON. | | `INVALID_PATH` | 400 | The request path is not a valid operation route. | | `MEMORY_EXCEEDED` | 400 | A hosted function exceeded the memory allowed by your plan. Delivered as a 422, see below. | | `MISSING_FUNCTION_ID` | 400 | The request did not identify an operation to run. | | `AUTH_EXPIRED` | 401 | The supplied upstream credentials or session are no longer valid. | | `AUTH_REQUIRED` | 401 | This operation requires credentials that were not supplied. | | `UNAUTHORIZED` | 401 | The x-api-key header is missing, unknown, or disabled. | | `FORBIDDEN` | 403 | Authenticated, but your plan or organization may not perform this action. | | `NETWORK_DENIED` | 403 | An outbound request was blocked by the SSRF guard (private, link-local, or loopback address). | | `NOT_FOUND` | 404 | No operation is published at this slug for your organization. | | `CHECKPOINT_REQUIRED` | 409 | The upstream site stopped the operation at a security checkpoint a person must clear (an in-app approval, an authenticator prompt, or an identity check). Retrying will not help. | | `CLIENT_REJECTED` | 409 | The upstream site rejected our client itself — a request signature, a device attestation, or an app-integrity check — rather than your input. Retrying, waiting, or routing through a different network will not change the answer. | | `IDEMPOTENCY_IN_FLIGHT` | 409 | The first request with this Idempotency-Key is still running. Retry to receive its result. | | `IDEMPOTENCY_KEY_REUSED` | 409 | This Idempotency-Key was already used for a different request. Use a new key. | | `NO_MOBILE_EXIT` | 409 | You asked a proxy lease for a mobile-carrier exit and none of the exits probed was cellular. Retrying with the same inputs gives the same answer: try a different mobileCountry, or drop the requirement and accept a residential exit. | | `PHONE_VERIFICATION_REQUIRED` | 409 | The upstream site stopped the operation and demanded a phone number. A person with a number is the only thing that clears it, so retrying will not help. | | `PHONE_CHECKPOINT_RATE_LIMITED` | 429 | The platform's phone-verification checkpoint refused more attempts. Wait before retrying; retrying now restarts the wait. | | `QUOTA_EXCEEDED` | 429 | A budget is spent: the month's weighted units, a trial's unit allowance, or your plan's hosted-function compute seconds. | | `RATE_LIMITED` | 429 | You exceeded the per-minute burst limit. It refills on its own within 60s. | | `SERVICE_BUSY` | 429 | Execution capacity is momentarily saturated. Retry with backoff. | | `INTERNAL_ERROR` | 500 | An unexpected failure on our side. Report it with the x-request-id. | | `MISSING_HANDLER` | 500 | The operation is registered without a runnable handler. | | `OPERATION_ERROR` | 500 | The operation raised an unclassified error while running. | | `NOT_IMPLEMENTED` | 501 | The operation exists but this code path is not implemented. | | `CAPTCHA_FAILED` | 502 | The upstream site presented a challenge that could not be solved. | | `INVALID_OUTPUT` | 502 | The operation's result did not match its declared output schema. | | `INVOCATION_FAILED` | 502 | The operation could not be dispatched to a worker. | | `PROXY_UNAVAILABLE` | 502 | No healthy proxy was available for an operation that requires one. | | `UPSTREAM_ERROR` | 502 | The third-party service returned an error or blocked the request. | | `UPSTREAM_INVALID_RESPONSE` | 502 | The third-party service answered in a shape we could not parse. | | `UPSTREAM_UNREACHABLE` | 502 | The third-party service could not be contacted at all. | | `AUTH_UNAVAILABLE` | 503 | A session surface could not reach our authentication infrastructure. Keyed calls see SERVICE_UNAVAILABLE for the same outage — retry shortly. | | `SERVICE_UNAVAILABLE` | 503 | A dependency of the platform is currently unavailable. | | `OPERATION_TIMEOUT` | 504 | The operation exceeded its own timeout budget. | | `UPSTREAM_TIMEOUT` | 504 | The third-party service the operation calls did not answer in time. | ## Semantics worth knowing [#semantics-worth-knowing] These are the cases where the obvious reading of a status is wrong. ### 404 does not distinguish "missing" from "not yours" [#404-does-not-distinguish-missing-from-not-yours] An unknown slug and an operation that exists but is not published to your organization both return `404 NOT_FOUND`, with the same message. This is deliberate: probing the gateway must not reveal which private operations exist. If you expected an operation to work and get a 404, check the marketplace listing rather than assuming a typo. ### Hosted-function failures arrive as a 4xx, whatever the code says [#hosted-function-failures-arrive-as-a-4xx-whatever-the-code-says] Cloudflare replaces any origin 5xx body with its own opaque error page, which would destroy the envelope. A hosted function's failures are attributable to your code, so the gateway deliberately returns them with an edge-safe status instead of the code's canonical one: | Code | Table says | You receive | | --------------------------------------------------------- | ---------- | ----------- | | `OPERATION_TIMEOUT` | 504 | 408 | | `SERVICE_BUSY` | 429 | 429 | | `MEMORY_EXCEEDED`, `INVALID_OUTPUT`, `OPERATION_ERROR`, … | 400 / 502 | 422 | The canonical status is preserved in an `X-Upapi-Execution-Status` header if you need it. This remapping applies **only** to hosted functions; marketplace operations return the status in the table above. A failure raised inside the isolate comes back as `{"error": "MEMORY_EXCEEDED", "message": "…"}` — `error` is a **string**, not the `{ code, message }` object. Read both shapes if you call hosted functions, exactly as the gateway itself does. ### `MEMORY_EXCEEDED` is a client error, and always a 422 [#memory_exceeded-is-a-client-error-and-always-a-422] Exceeding the memory your plan allows is treated as a problem with the request — you asked for more than you bought — so it is a client error rather than a 500. Only a hosted function can raise it, so on the wire it is always a `422` by the remapping above, never the `400` the code table lists. Retrying the same call unchanged will fail the same way; either shrink the workload or move up a plan. ### `AUTH_UNAVAILABLE` is a 503, not a 401 — on session surfaces [#auth_unavailable-is-a-503-not-a-401--on-session-surfaces] This code means our authentication infrastructure could not be reached, so your credentials were never checked. It is an outage signal, not a credential signal. Retry with backoff; do not rotate keys and do not surface "invalid credentials" to your users. It is emitted by the surfaces that authenticate a **session**: the dashboard, the marketplace try-it runner, and the hosted MCP endpoint. A call authenticated with an API key gets `503 SERVICE_UNAVAILABLE` for the same outage — a different code, the same status and the same response. Handle both. ### 429 arrives with a reason [#429-arrives-with-a-reason] Three codes share the 429 status, and the code — not the status, and not the size of `Retry-After` — is what tells you whether waiting will help: * `RATE_LIMITED` — you exceeded the **per-minute burst limit**. This is the one 429 that clears itself: the window refills within 60 seconds and nothing has been spent. Wait and retry. * `QUOTA_EXCEEDED` — a **budget is spent**. That is the month's weighted units, a trial's included units, or your plan's compute seconds for [hosted functions](https://upapi.io/docs/platform/hosted-functions). Retrying is pointless until the budget refills; `Retry-After`, where present, points at the moment it actually does — the next UTC month, or the end of your trial. Upgrading is the other fix. * `SERVICE_BUSY` — execution capacity is momentarily saturated. Retry with backoff. A monthly-quota or trial-cap rejection used to be `RATE_LIMITED` as well, leaving `Retry-After`'s magnitude as the only clue. If your client branches on `RATE_LIMITED` alone, it now retries only the burst window — which is what it should always have done. Handle `QUOTA_EXCEEDED` as a stop. See [Rate limits](https://upapi.io/docs/rate-limits) for the headers that tell you which is which before you hit them. ### The two 409s are about idempotency, and only one is your mistake [#the-two-409s-are-about-idempotency-and-only-one-is-your-mistake] Both are raised by [`Idempotency-Key`](https://upapi.io/docs/api#idempotency) handling: * `IDEMPOTENCY_KEY_REUSED` — you sent a key that a **different** request already used. Nothing ran. Two requests may not share a key; generate a new one. * `IDEMPOTENCY_IN_FLIGHT` — you sent a key whose first request is **still running**. Nothing ran twice, either. Wait for `Retry-After` (one second) and send the same request again; you will get the first one's stored response. ### The two proxy codes name whose proxy failed [#the-two-proxy-codes-name-whose-proxy-failed] Both mean a proxy refused to carry the request, and the fix is on opposite sides: * `PROXY_UNAVAILABLE` (502) — **our** exit pool. No proxy was available, or the one we leased stopped working mid-call. Nothing about your request caused it and nothing in your request can fix it. Retry: a later call leases a different exit. * `CALLER_PROXY_AUTH_REJECTED` (400) — the proxy **you** supplied, through an operation's `proxyUrl`, the `x-proxy-url` header, or your organization's configured proxy list, answered our connection with `HTTP 407`. Check its credentials, and whether your provider requires allow-listing the IP that connects to it. Retrying unchanged fails identically. ### 5xx codes name the layer that failed [#5xx-codes-name-the-layer-that-failed] `UPSTREAM_*` codes mean the third-party service an operation wraps misbehaved — the platform worked. `OPERATION_ERROR` and `INVALID_OUTPUT` point at the operation itself. `INTERNAL_ERROR` is ours; report it with the `x-request-id`. ## Retrying [#retrying] Retry `SERVICE_BUSY`, `SERVICE_UNAVAILABLE`, `AUTH_UNAVAILABLE`, `IDEMPOTENCY_IN_FLIGHT`, the `UPSTREAM_*` family and `RATE_LIMITED` — with exponential backoff, and always respecting `Retry-After` when it is present. Do not retry `INVALID_INPUT`, `INVALID_JSON`, `INVALID_PATH`, `NOT_FOUND`, `UNAUTHORIZED`, `FORBIDDEN`, `MEMORY_EXCEEDED`, `IDEMPOTENCY_KEY_REUSED`, `CALLER_PROXY_AUTH_REJECTED` or `QUOTA_EXCEEDED` without changing something first; the same request will fail identically. Because an operation is a POST with real upstream side effects, a retry that is *safe* is not automatically a retry that is *free* — send an [`Idempotency-Key`](https://upapi.io/docs/api#idempotency) so a retried call replays the first result instead of running and billing a second time. The [TypeScript SDK](https://upapi.io/docs/sdk) implements exactly this policy, idempotency key included. A request body over 5 MB is rejected at the edge, before it reaches the gateway, with `413` and the code `PAYLOAD_TOO_LARGE`. That code is not part of the operation vocabulary above — treat any oversized-body handling as a separate branch. --- # FAQ (https://upapi.io/docs/faq) Each answer is the short version. The linked page is the full one, and wins if the two ever disagree. ## Accounts and keys [#accounts-and-keys] ### Can I try upAPI without an account? [#can-i-try-upapi-without-an-account] Yes, when guest access is on. A guest explores the marketplace and the dashboard, runs operations from the try-it panel and can create API keys, then converts to a real account later without losing what it made. A guest is bounded by limits rather than by missing features: * A guest organization has no subscription, so it gets the Free tier's per-minute limit and monthly units ([Plans](https://upapi.io/docs/plans)). * Try-it runs from a guest are also capped per IP address, per minute and per day, because the panel runs operations for a guest without billing them. * A guest cannot connect to the hosted MCP server. It answers `401 GUEST_FORBIDDEN`, because guest identities are temporary and get reaped. The local MCP server works with a guest's key. * A guest cannot invite members to its organization. ### What does an API key have access to? [#what-does-an-api-key-have-access-to] A key belongs to the organization that created it, not to the person who created it. It keeps working when that person leaves, and every admin sees and manages the same keys. Keys carry no per-operation scoping today. A key can call every operation published to your organization. When you create one you choose between two access levels: * **Full access** runs operations and reads your plan, quota and usage. * **Execute only** runs operations but gets `403 FORBIDDEN` from [`GET /api/usage`](https://upapi.io/docs/usage-api). An organization holds up to 20 keys, each shown exactly once at creation. Ask your agent to run `create_api_key` and `revoke_api_key`, or use the API keys page; both manage the same keys. There is no key-management REST API. [Authentication](https://upapi.io/docs/authentication) has the key format and failure modes. ### Do more keys give me more quota? [#do-more-keys-give-me-more-quota] No. The monthly units and the per-minute limit are both pooled across all of an organization's keys. Ten keys share one budget. ## Quotas and cost [#quotas-and-cost] ### How is usage counted? [#how-is-usage-counted] In weighted units, not requests. Every operation declares how many units a call spends. Across everything you can call today, a single request spends between **1 and 25 units**. Each operation's weight is published in [`/api/catalog`](https://app.upapi.io/api/catalog) and on its marketplace page, so you can price a workload before you build it ([Rate limits](https://upapi.io/docs/rate-limits)). Two limits apply to every call: * **A per-minute burst limit** counts requests on a rolling 60-second window. It answers `429 RATE_LIMITED`. * **A monthly quota** counts units and resets at the start of each UTC month. It answers `429 QUOTA_EXCEEDED`. There is no overage charge. The dashboard notifies you at **25%, 50%, 75%, 90% and 100%** of the month's units. [`GET /api/usage`](https://upapi.io/docs/usage-api) reports where you stand without spending anything. ### What does a failed call cost? [#what-does-a-failed-call-cost] You pay only for calls an operation actually ran: | Outcome | Units | | ---------------------------------------------------- | ---------- | | The operation ran, whatever status it returned | Its weight | | `400`, `401` or `404` from the gateway, before a run | 0 | | `429`, throttled or out of quota | 0 | | `x-upapi-cache: HIT` | 0 | | `Idempotency-Replayed: true` | 0 | The case to read twice is a 4xx. If the **gateway** refused the call, for a missing field, a malformed body, a bad key or an unknown operation, it costs nothing. If the **operation** returned the 4xx, it ran, so the call is billed at its weight. [Errors](https://upapi.io/docs/errors) lists every code and says which layer returns it. ### Are responses cached, and what does a cached answer cost? [#are-responses-cached-and-what-does-a-cached-answer-cost] Most operations declare a cache TTL, shown on each operation's marketplace page. A response served from cache carries `x-upapi-cache: HIT` and costs zero units. A cacheable operation that executes answers `x-upapi-cache: MISS`; test for `HIT` only. Sending `Cache-Control: no-cache` skips the cache read, answers `BYPASS` and is billed as a normal call. Postman sends that header by default and Chrome does with "Disable cache" open, so repeats from those clients are billed at full weight. A few operations are never cached because a stale answer would be wrong: the polling and liveness endpoints, such as a transcription result or an email verification read. Sending a [custom proxy](https://upapi.io/docs/platform/proxies) also skips the cache for that call. ## MCP and agents [#mcp-and-agents] ### Hosted or local MCP server? [#hosted-or-local-mcp-server] Prefer the hosted server. The local one is the fallback. | | Hosted | Local | | --------------- | ---------------------------------- | ------------------------------------ | | Endpoint | `https://app.upapi.io/api/mcp` | `npx -y @upapi/mcp`, over stdio | | Sign-in | OAuth in a browser, no key on disk | `UPAPI_API_KEY` in the client config | | Accounts | Full accounts only, never guests | Any key, including a guest's | | Catalog | Every public operation | Catches up in the next release | | Burst limit per | Organization | API key | Both draw on the same monthly units, and a tool call is metered exactly like the equivalent REST call. The hosted server serves every public operation; the local one catches up in the next `@upapi/mcp` release ([MCP server](https://upapi.io/docs/mcp)). {/* TODO(mcp-release, 2026-10-08): drop the qualifier after @upapi/mcp 0.3.0 ships (order: sdk → mirror --only mcp → mcp → registry → mcpb → GH release) */} Per-client configuration is in [Connect an MCP client](https://upapi.io/docs/mcp-clients). ### Can a coding agent set all of this up for me? [#can-a-coding-agent-set-all-of-this-up-for-me] Yes. Paste this sentence into Claude Code, Codex, Cursor, OpenCode or any other coding agent: ```text Fetch and execute the appropriate instructions to set me up for upAPI from https://upapi.io/docs/agent-setup/prompt.md ``` The agent fetches [prompt.md](https://upapi.io/docs/agent-setup/prompt.md), connects the MCP server, installs the SDK and checks both with calls that cost nothing. It asks you only for a browser sign-in or a key. [Agent setup](https://upapi.io/docs/agent-setup) has the same steps for each agent, written for a human. ## Still stuck? [#still-stuck] The [status page](https://app.upapi.io/status) shows live platform health. [Support](https://upapi.io/docs/platform/support) explains how to reach a person. --- # File inputs (https://upapi.io/docs/file-inputs) Some operations take a file: an image to run OCR on, a PDF to extract text from, an audio file to transcribe. There are two ways an operation can ask for one, and which one it uses is declared in its input schema. You can tell them apart at a glance, and the difference decides how large a file you can send. ## 1. Inline base64 [#1-inline-base64] The operation declares a string parameter carrying `contentEncoding: "base64"`: ```json { "type": "object", "properties": { "image": { "type": "string", "contentEncoding": "base64", "contentMediaType": "image/png", "description": "The image to read text from" } }, "required": ["image"] } ``` Send the file's bytes base64-encoded, with **no `data:` URL prefix**: ```bash curl -X POST https://api.upapi.io/image-ocr \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'content-type: application/json' \ -d "{\"image\": \"$(base64 -w0 receipt.png)\"}" ``` ```ts const bytes = await readFile('receipt.png'); await fetch('https://api.upapi.io/image-ocr', { method: 'POST', headers: { 'x-api-key': key, 'content-type': 'application/json' }, body: JSON.stringify({ image: bytes.toString('base64') }), }); ``` `contentMediaType`, when present, tells you which formats the operation accepts. ### Size limit — do the math before you send [#size-limit--do-the-math-before-you-send] The request body is capped at **5 MB**, and base64 inflates a file by **4 bytes for every 3** (about 33%). A little headroom is reserved for the rest of the JSON body — the other parameters, the key names, the quoting — which leaves roughly: | | | | --------------------- | ------------ | | Request body cap | 5 MB | | JSON envelope reserve | 64 KB | | **Largest real file** | **≈ 3.7 MB** | Sending more returns `413 PAYLOAD_TOO_LARGE` at the edge, before the operation runs. If your file is bigger, use an operation that takes a URL instead — or host the file yourself and pass its URL. The "Try it" panel on an operation's marketplace page renders a file picker for these parameters, checks the size before it encodes anything, and does the base64 encoding for you. ## 2. A URL the operation fetches [#2-a-url-the-operation-fetches] Larger inputs — audio, video, long PDFs — are passed **by reference**. The operation declares a `uri` parameter and fetches the file itself, so nothing large crosses the API gateway and the 5 MB cap does not apply: ```json { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "x-upapi-upload": true, "description": "Publicly reachable URL of the audio to transcribe (e.g. https://example.com/talk.mp3)" } }, "required": ["url"] } ``` ```bash curl -X POST https://api.upapi.io/audio-transcribe.post \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'content-type: application/json' \ -d '{"url": "https://example.com/talk.mp3"}' ``` The URL must be reachable from the public internet — a `localhost` address, a private-network address or a link behind a login will fail. ### `x-upapi-upload` [#x-upapi-upload] `"x-upapi-upload": true` marks a URL parameter as one whose value **may be a file of yours**, as opposed to a URL that is inherently someone else's (the page a scraper reads, for example). It changes nothing about how the API validates your request — `x-` keywords are ignored by JSON Schema validators — and you can always just pass a URL you already have. What it does change is the "Try it" panel: for a marked parameter, when hosted uploads are enabled on the deployment you are using, the panel offers an **Upload a file** button that stores your file and fills the field with its public URL. When they are not enabled, the field is an ordinary URL box and nothing else differs. ## Reading a file back out [#reading-a-file-back-out] An operation that *returns* a file uses the same base64 convention on its output schema. The response is bounded the same way, so operations that produce large artifacts return a URL instead. ## Summary [#summary] | | Inline base64 | URL reference | | ------------- | --------------------------- | ----------------------------------------- | | Schema marker | `contentEncoding: "base64"` | `format: "uri"` (+ `x-upapi-upload`) | | Max size | ≈ 3.7 MB | Bounded by the operation, not the gateway | | You send | The encoded bytes | A public URL | | Good for | Images, small documents | Audio, video, large documents | --- # Free tools (no key) (https://upapi.io/docs/free-tools) A few operations are also **free tools**: anyone can call them without an account or an API key, from a browser or from code. Each is listed on [upapi.io/tools](https://upapi.io/tools), runs in a box on the page linked below (its own tool page or its operation page), and has an endpoint at `https://app.upapi.io/api/tools/`. | Tool | Endpoint | Operation | | ----------------------------------------------------------------------- | ---------------------------------------------------------- | -------------------------- | | [Open Graph checker](https://upapi.io/tools/open-graph-checker) | `/api/tools/open-graph-checker?url=` | `opengraph-parse.get` | | [Sitemap URL extractor](https://upapi.io/apis/seo-tools/sitemap-parse) | `/api/tools/sitemap-url-extractor?url=&limit=` | `sitemap-parse.get` | | [Google Autocomplete](https://upapi.io/apis/search/google-autocomplete) | `/api/tools/google-autocomplete?query=&language=&country=` | `google-autocomplete.post` | | [Crypto price checker](https://upapi.io/apis/finance/crypto-price) | `/api/tools/crypto-price?coins=&vsCurrencies=` | `crypto-price.get` | ```bash curl "https://app.upapi.io/api/tools/open-graph-checker?url=https%3A%2F%2Fgithub.com" ``` ## The contract [#the-contract] * **No key, no cookie.** CORS is open (`Access-Control-Allow-Origin: *`). * **GET or POST.** GET takes the parameters as a query string; POST takes the same names as a JSON object. Only the parameters listed for a tool reach the operation: options that cost upstream requests (a proxy, the autocomplete `expand` switch) need a key. * **JSON by default, Markdown on request.** Send `Accept: text/markdown` for a Markdown rendering of the same result. * **Errors are RFC 9457** `application/problem+json` documents, with the same `code` the keyed gateway uses (`INVALID_INPUT`, `RATE_LIMITED`, `NOT_FOUND`, `UPSTREAM_ERROR`…) and a `Retry-After` header on a 429. * **Limits.** Each IP address gets 30 runs a minute and 300 a day across all free tools together, and each tool has a daily capacity shared by every caller. With a key, the same operation at `https://api.upapi.io/` has neither limit. * Every response carries `X-Tool-Docs` (the tool's page) and `X-Request-Id`. ## Machine-readable [#machine-readable] * [`/api/tools`](https://app.upapi.io/api/tools) lists every free tool, plus the free tools other Devino apps run, as JSON (or Markdown). * [`/api/tools/openapi.json`](https://app.upapi.io/api/tools/openapi.json) is an OpenAPI 3.0 document of the endpoints, every path `security: []`, tagged "Free tools". * The [API catalog](https://upapi.io/.well-known/api-catalog) (RFC 9727) lists the free tools as their own API. --- # upAPI documentation (https://upapi.io/docs) upAPI is an API marketplace. Every listing is an **operation** — a single callable endpoint with a declared input schema, a declared output schema and a price in weighted units. You reach all of them through one gateway, with one key, drawing on one quota. That last part is the whole point. Most marketplaces make you sign up per API, hold a key per API and buy a quota per API. Here, the key you create in the dashboard calls every public operation, and a month's usage is a single pooled number no matter which mix of operations produced it. ## Where things live [#where-things-live] | Surface | URL | What it is | | ----------- | -------------------------------------------------------- | --------------------------------------------------------- | | Marketplace | [upapi.io/marketplace](https://upapi.io/marketplace) | Browse operations, read schemas, run one from the browser | | Dashboard | [app.upapi.io/dashboard](https://app.upapi.io/dashboard) | Keys, usage, billing, products, hosted functions | | Gateway | `https://api.upapi.io` | Where your code calls operations | | Status | [app.upapi.io/status](https://app.upapi.io/status) | Live health of the platform | Operations are grouped into categories on the [marketplace index](https://upapi.io/marketplace), and each one has a detail page at `upapi.io/apis/{category}/{name}` carrying its schema, a curl example, code snippets and a link to a runnable playground. That page is where a specific operation is documented; this site documents the platform around it. The catalog is also served live at [app.upapi.io/api/catalog](https://app.upapi.io/api/catalog), so it tracks what exists far more closely than any page here can. ## Calling an operation [#calling-an-operation] Every call is a `POST` to the operation's slug, with your key in `x-api-key` and the input as a JSON body: ```bash curl -X POST https://api.upapi.io/github-trending.get \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'content-type: application/json' \ -d '{"since":"weekly","limit":5}' ``` There is no `GET` form — see [Authentication](https://upapi.io/docs/authentication) for why, and [Quickstart](https://upapi.io/docs/quickstart) to get from zero to that call. ## Ways in [#ways-in] ## Beyond the catalog [#beyond-the-catalog] The platform also runs code and configuration you own: * **[Hosted functions](https://upapi.io/docs/platform/hosted-functions)** — your own TypeScript, executed in a V8 isolate behind the same gateway, key and metering. * **[Products](https://upapi.io/docs/platform/products)** — bundle operations you use together. * **[Proxies](https://upapi.io/docs/platform/proxies)** — bring your own egress IP, per request or per organization. --- # Connect an MCP client (https://upapi.io/docs/mcp-clients) **Onboard your AI agent to upAPI:** [Claude](https://claude.ai/directory/upapi), [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac97e64f7988191967fd96df23a0822), or add `https://app.upapi.io/api/mcp` (HTTP) to any other MCP client and sign in with your upAPI account. Pick a transport, then copy the block for your client. Both transports expose tools with the same schemas and draw on the same monthly pool of [weighted units](https://upapi.io/docs/rate-limits). They differ in how a call is authenticated, and — following from that — in what the per-minute burst limit is counted against: the hosted server meters per organization, the local server per API key. Both servers serve the same catalog and the same account tools; the local server gets new tools when you update `@upapi/mcp`. See [MCP tools](https://upapi.io/docs/mcp-tools) for the current list. See [MCP server](https://upapi.io/docs/mcp) for what the tools look like once connected. To let a coding agent do all of this itself, see [Agent setup](https://upapi.io/docs/agent-setup). | Transport | Hosted | Local | | --------- | ------------------------------ | ------------------------------- | | Endpoint | `https://app.upapi.io/api/mcp` | `npx -y @upapi/mcp` (stdio) | | Auth | sign in to upAPI in a browser | `UPAPI_API_KEY` in the config | | Runs | on upAPI | on your machine | | Best for | desktop clients and IDEs | scripts, CI, self-hosted agents | Prefer the hosted server. It authorizes over OAuth 2.1 with PKCE against the same accounts system as the dashboard, so there is no key to paste into a file on disk and no key to rotate when a laptop is lost. A [guest session](https://upapi.io/docs/quickstart#1-create-an-account) cannot connect: the endpoint answers `401 GUEST_FORBIDDEN`. Guest identities are temporary and get reaped, which would break a long-lived integration in a way you could not diagnose from the client. Convert the guest account first — the local server has no such restriction, since it authenticates with an API key. For the local server, create a key first: ask your agent to run `create_api_key` over the hosted connection, or use the [API keys page](https://app.upapi.io/dashboard/api-keys). It reads two environment variables: | Variable | Required | Value | | ----------------- | -------- | ---------------------------------------------------------------- | | `UPAPI_API_KEY` | Yes | an `upapi_` key | | `UPAPI_BASE_URL` | No | gateway origin, defaults to `https://api.upapi.io` | | `UPAPI_TOOL_MODE` | No | `compact` (default), `directory`, `claude` or `full` — see below | ## Which tools you get [#which-tools-you-get] Within a transport, every mode serves the same operations. What changes between modes is how many of them are *advertised* in `tools/list` — a context-budget and presentation choice, never an access one. An operation a mode does not list is still callable by name. | Mode | Advertises | Use it when | | ----------- | ------------------------------------------------------------- | ----------------------------------------------------------------- | | `compact` | `search_ops` + `call_op` + three always-on operations | a long chat that re-sends its tool table every turn | | `directory` | 11 named flagship tools, read tools and write tools separated | a desktop client, or anywhere a human reads the tool list | | `claude` | 8 named tools upAPI computes itself, reads and writes split | the Claude connector listing | | `full` | one tool per public operation | a fixed workflow that wants every schema present without a lookup | Every tool in every mode carries the four MCP behavioural hints — `readOnlyHint`, `destructiveHint`, `idempotentHint` and `openWorldHint` — so a client can decide what may run unattended without inferring it from a name. The hosted server picks the mode from the URL and defaults to `compact`: ```text https://app.upapi.io/api/mcp # compact https://app.upapi.io/api/mcp?tools=directory # named flagship tools https://app.upapi.io/api/mcp?tools=claude # named tools upAPI computes itself https://app.upapi.io/api/mcp?tools=full # one tool per operation ``` The local server reads `UPAPI_TOOL_MODE` and defaults to `compact`, the same shape the hosted endpoint defaults to. `full` (one tool per operation, this server's original default) remains available as a rollback for a client already configured against it. An unrecognized value falls back to the default rather than refusing to start. The snippets below register the server as `upAPI`. Client config keys are case-sensitive, so if you added it earlier as `upapi`, the old entry keeps working but sits beside the new one and every tool appears twice. Remove the old one: `claude mcp remove upapi` in Claude Code, or delete the `upapi` key from `claude_desktop_config.json`, `.cursor/mcp.json` or `.vscode/mcp.json`. ## Claude Code [#claude-code] ```bash title="Hosted" claude mcp add --transport http upAPI https://app.upapi.io/api/mcp ``` Claude Code opens a browser to authorize the connection on first use. ```bash title="Local" claude mcp add upAPI --env UPAPI_API_KEY=upapi_YOUR_KEY -- npx -y @upapi/mcp ``` ## Claude Desktop [#claude-desktop] The shortest path is the **desktop extension**. Download `upapi.mcpb` from the [latest release](https://github.com/DevinoSolutions/upapi-mcp/releases/latest), double-click it, and paste your API key when Claude Desktop asks: the key is held as a sensitive setting rather than written into a config file on disk, and the extension defaults to the `directory` tool table. For the hosted server, add it through the app rather than the config file: open [upAPI in the Claude directory](https://claude.ai/directory/upapi), click Add, then sign in with your upAPI account and allow access. The connector syncs to Claude Desktop. Claude connects from Anthropic's infrastructure rather than from your machine, which is fine here — the endpoint is public. The local server goes in `claude_desktop_config.json`: ```json title="claude_desktop_config.json" { "mcpServers": { "upAPI": { "command": "npx", "args": ["-y", "@upapi/mcp"], "env": { "UPAPI_API_KEY": "upapi_YOUR_KEY" } } } } ``` Restart Claude Desktop; the operations appear in its tool list. ## Cursor [#cursor] One click installs the hosted server: [**Add upAPI to Cursor**](cursor://anysphere.cursor-deeplink/mcp/install?name=upAPI\&config=eyJ1cmwiOiJodHRwczovL2FwcC51cGFwaS5pby9hcGkvbWNwIn0=). The link only opens Cursor's install dialog — nothing is written until you confirm there. Both forms also go in `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global): ```json title=".cursor/mcp.json — hosted" { "mcpServers": { "upAPI": { "url": "https://app.upapi.io/api/mcp" } } } ``` ```json title=".cursor/mcp.json — local" { "mcpServers": { "upAPI": { "command": "npx", "args": ["-y", "@upapi/mcp"], "env": { "UPAPI_API_KEY": "upapi_YOUR_KEY" } } } } ``` ## VS Code [#vs-code] VS Code uses `servers` rather than `mcpServers`, and wants an explicit `type`. Put this in `.vscode/mcp.json` for one workspace, or in your user profile's `mcp.json` for all of them: ```json title=".vscode/mcp.json — hosted" { "servers": { "upAPI": { "type": "http", "url": "https://app.upapi.io/api/mcp" } } } ``` For the local server, take the key from a prompted input rather than hardcoding it — `.vscode/mcp.json` is usually committed: ```json title=".vscode/mcp.json — local" { "inputs": [ { "type": "promptString", "id": "upapi-key", "description": "upAPI API key", "password": true } ], "servers": { "upAPI": { "type": "stdio", "command": "npx", "args": ["-y", "@upapi/mcp"], "env": { "UPAPI_API_KEY": "${input:upapi-key}" } } } } ``` ## Other clients [#other-clients] Any client that can launch a stdio server takes the same command (`npx -y @upapi/mcp`) with `UPAPI_API_KEY` in its environment, and any client that speaks remote MCP takes the hosted URL. Nothing in either transport is client-specific. Every `UPAPI_API_KEY` block above puts a live key in plain text on disk. Use a key created for this purpose so you can delete it without disturbing production, keep the file out of dotfile repositories, and prefer the hosted server or VS Code's `inputs` prompt where you can. --- # MCP tools (https://upapi.io/docs/mcp-tools) {/* GENERATED by scripts/generate-mcp-docs.ts. Run `pnpm docs:mcp-tools`. Do not edit by hand. */} upAPI exposes every public catalog operation through `search_ops` and `call_op` (or one tool per operation with `?tools=full`), plus **59 account tools** that do everything the dashboard does. The hosted server and the local `@upapi/mcp` server serve the same list. You choose which permission tiers a connection holds on the consent screen. Read + write are on by default; the account tiers are opt-in, and `request_scopes` returns a link to widen them later. ## Read your data (`read`) [#read-your-data-read] | Tool | What it does | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | `billing_status` | Current plan, renewal date, trial, quota used and remaining. | | `list_plans` | Plans with price, monthly quota and limits. | | `get_profile` | Your name, email, workspace and role. | | `get_account_summary` | Plan, role, usage and workspace summary. | | `get_usage` | Monthly units used and remaining, per-minute limits, trial cap, compute and hosted-function usage, broken down by key and connected client. | | `list_call_logs` | Recent operation calls with status, caller and cost. | | `list_members` | Workspace members and roles. | | `list_invites` | Pending invitations. | | `list_support_tickets` | Your earlier support requests. | | `list_api_keys` | Keys with name, prefix, mode (live or test), scopes, last used. | | `list_granted_scopes` | Tiers and scopes this connection holds. | | `request_scopes` | Returns a click-ready link where the user grants more permission tiers to this connection. | | `list_connections` | AI apps connected to this account and when each last ran. | | `list_user_apis` | Remote-URL APIs you published to your workspace. | | `get_proxy_config` | Proxy URLs used for outbound requests. | | `list_hosted_functions` | Your deployed functions. | | `get_hosted_function` | One function including its code. | | `list_products` | Products and the operations in each. | | `get_referral` | Your referral link and earnings. | ## Create and edit (`write`) [#create-and-edit-write] | Tool | What it does | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | `create_user_api` | Publish a remote HTTP API as an operation. | | `update_user_api` | Change one of your published APIs. Fields you leave out of the patch keep their stored value, including secret headers. | | `set_proxy_config` | Replace the proxy URL list. | | `test_proxy_config` | Check that a proxy URL works. | | `deploy_hosted_function` | Create a function from code. | | `update_hosted_function` | Change code, description, secrets, input fields, category, tags or timeout. Secrets you leave out of the patch are kept. | | `create_product` | Group operations into a product. | | `update_product` | Rename or redescribe a product. | | `assign_operation_to_product` | Add an operation to a product, or send it back to the default product. | | `create_upload_url` | A presigned upload URL for a file input of an operation. | ## Delete, publish or send (`destructive`) [#delete-publish-or-send-destructive] | Tool | What it does | | ------------------------ | ------------------------------------------------------------------------------------ | | `delete_user_api` | Deletes a published API. Needs a confirmToken. | | `delete_hosted_function` | Deletes a function. Needs a confirmToken. | | `delete_product` | Deletes a product; its operations move to the default product. Needs a confirmToken. | ## Billing and subscription (`billing`) [#billing-and-subscription-billing] | Tool | What it does | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `upgrade_plan` | Returns a one-click checkout link for a plan. Ask the user which plan; never choose for them. | | `manage_subscription` | cancel (at period end), refund (last payment, revokes access) or open the billing portal. cancel and refund need a confirmToken. | ## Profile, preferences, account deletion (`account`) [#profile-preferences-account-deletion-account] | Tool | What it does | | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `update_profile` | Change your display name or avatar URL. | | `update_workspace` | Rename the workspace (admin or owner). | | `change_password` | Set a new password. Accounts that already have one must also pass currentPassword. | | `update_notification_prefs` | Read or change in-app tips and prompts and usage-alert emails. Omit both fields to just read. | | `register_push_token` | Register a device push token for notifications. | | `remove_push_token` | Unregister a device push token. | | `export_data` | Profile, workspace, members, keys (prefixes only), BYO APIs, hosted functions, products and 90 days of call logs as JSON. Large exports return a download link. | | `delete_account` | Ask the user to confirm the workspace name before calling; never decide for them. Permanently closes the account and deletes the workspace, its keys, APIs, functions and data (support can restore from backups on request). Cancels the paid plan first; a plan bought through Apple, Google or Amazon only the user can cancel, so when the answer has storeNotice, show it to them word for word. Needs a confirmToken; owner only. | | `complete_onboarding` | Mark the welcome checklist done. | | `update_referral_ui_state` | Dismiss or answer the referral prompts. | ## Members and invites (`team`) [#members-and-invites-team] | Tool | What it does | | -------------------- | ------------------------------------------------------------------------------------------------------------- | | `invite_member` | Ask the user who to invite and with which role; never choose for them. Emails an invitation (admin or owner). | | `update_member_role` | Change a member between member and admin. | | `remove_member` | Remove a member from the workspace. Needs a confirmToken. | | `revoke_invite` | Cancel a pending invitation. | | `accept_invitation` | Accept an invitation addressed to your email. | ## Connected services (`connections`) [#connected-services-connections] | Tool | What it does | | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `get_connect_links` | Install links for Claude, Cursor, VS Code, Claude Code, Codex and OpenCode. | | `disconnect` | Revokes a connected app immediately. Needs a confirmToken. | | `connect_platform` | Connects a platform login (cookies), not an AI app connection. Returns a one-time link and steps for the user to log in and hand upAPI their session. Relay the steps; never ask for cookies in chat. Refused for API keys. | | `list_platform_accounts` | Platform logins (cookies) connected to this workspace, not AI apps: platform, account, status, last check. Never returns cookies. | | `check_platform_account` | Re-checks a connected platform login and updates its status. Runs one metered operation where a reliable check exists. | | `disconnect_platform_account` | Deletes a stored platform login (cookies), not an AI app connection. Needs a confirmToken. Refused for API keys. | ## Support tickets (`support`) [#support-tickets-support] | Tool | What it does | | ----------------------- | -------------------------------------------------- | | `create_support_ticket` | Send a support request; the team replies by email. | ## API keys (`keys`) [#api-keys-keys] | Tool | What it does | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `create_api_key` | Ask the user which permissions the key needs; never choose for them. Creates a key and returns the secret once. Omit tiers for all. mode "test" mints a upapi\_test\_ key that answers every operation with a sample, never spends units and cannot use account tools. | | `rotate_api_key` | Creates a replacement with the same scopes and returns the secret once; the old key keeps working until you revoke it. | | `revoke_api_key` | Deletes a key immediately. Needs a confirmToken. | Destructive tools answer once with `CONFIRMATION_REQUIRED` and a `confirmToken`. Repeat the call with the token to proceed. Every refusal is `{ code, message, next }`, and `next` names the tool to call. --- # MCP server (https://upapi.io/docs/mcp) **Onboard your AI agent to upAPI:** [Claude](https://claude.ai/directory/upapi), [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac97e64f7988191967fd96df23a0822), or add `https://app.upapi.io/api/mcp` (HTTP) to any other MCP client and sign in with your upAPI account. The Model Context Protocol lets an AI assistant call tools. upAPI publishes its operations over MCP, so an operation becomes a tool the assistant can invoke — with your key, your quota and the same schemas as the REST gateway. There are two ways to connect, described below. They differ in how you authorize and in how much of the catalog they serve. For the configuration to paste into a specific client, see [Connect an MCP client](https://upapi.io/docs/mcp-clients). ## Hosted server [#hosted-server] `https://app.upapi.io/api/mcp` speaks MCP over streamable HTTP and authorizes over OAuth 2.1 with PKCE, against the same accounts system as the dashboard. A client connects by signing in through a browser, so no API key is ever written into a config file. Each request re-establishes your identity from the access token, and tool calls execute on exactly the path the marketplace try-it panel uses — the same plan gating and the same meter. A [guest session](https://upapi.io/docs/quickstart#1-create-an-account) cannot connect; see [Connect an MCP client](https://upapi.io/docs/mcp-clients) for why. A request with no valid credential is answered `401` with a `WWW-Authenticate` header that points at the OAuth resource metadata, which is how a client discovers where to sign in. A client that keeps sending requests with no bearer token at all from one IP address (a misconfigured agent retrying in a loop) is answered `429 RATE_LIMITED` with a `Retry-After` header after its first 20 such requests in a minute, or 300 in an hour. The `429` keeps the `WWW-Authenticate` header, and `Retry-After` is the time until the window that turned the request away closes. Requests the minute limit turns away still count toward the hourly 300, so a client that keeps hammering through a `429` can be pushed into an hour-long wait: stop and honor `Retry-After`. Only a request with no bearer token is limited. A request that carries one is never counted and never answered `429`, whether the token is valid, expired or unknown: an expired token still gets the `401` that tells your client to refresh it. The OAuth discovery endpoints (the authorization server and protected-resource metadata) are separate routes and are not limited. Clients normally register themselves through dynamic client registration. Marketplaces whose tenant admins cannot (Microsoft 365 Copilot, Gemini Enterprise) get a static confidential client instead: the operator lists it in the `OAUTH_STATIC_CLIENTS` environment variable (client id, secret, name, exact redirect URIs, token-endpoint auth method), and every boot upserts it into the same client table. Such a client authenticates with its secret, never expires, and is left in place if it is later removed from the variable. The hosted server serves **every public operation**, the same catalog as the REST gateway. Operations that write something, such as posting a comment or opening a mailbox, carry `readOnlyHint: false`, so your client can ask before it runs them. ## Local server [#local-server] The `upapi-mcp` command speaks MCP over stdio and forwards each tool call to `api.upapi.io` with your API key. It runs on your machine, alongside the client. It authenticates with the key in `UPAPI_API_KEY` and validates nothing itself — your key is checked at the same gateway choke point as any other call, so an MCP tool call is metered and rate-limited exactly like the equivalent `curl`. Point it at a different gateway origin with `UPAPI_BASE_URL` if you need to. The hosted server serves every public operation and every account tool. The local server gets new tools when you update `@upapi/mcp`. ## Account tools [#account-tools] Besides the catalog, the server has account tools that do everything the dashboard does: billing and plan changes, API keys, team, support, connected apps, your own APIs and hosted functions, products, referral and usage. The full list is generated from the tool registry on [MCP tools](https://upapi.io/docs/mcp-tools). On the consent screen you choose which permission tiers a connection holds. All are on by default. A tool outside the connection's tiers answers `SCOPE_MISSING` and `next` points at `request_scopes`, which returns a link where you grant more. Deleting or cancelling answers once with `CONFIRMATION_REQUIRED` and a `confirmToken`; repeat the call with it to proceed. A step that needs a browser, such as checkout, comes back as a one-time link. ## What the tools look like [#what-the-tools-look-like] Each public operation becomes one tool, with the operation's input schema as its parameter schema. The assistant sees the same field names, types and descriptions the marketplace shows you, so it can fill arguments without guessing. How many of those tools are advertised at once is a choice — `compact`, `directory` or `full`, set on the URL for the hosted server and in `UPAPI_TOOL_MODE` for the local one. All three are built from the same tool table, so the mode changes what is listed and never what is reachable. See [Which tools you get](https://upapi.io/docs/mcp-clients#which-tools-you-get). Every tool declares the four MCP behavioural hints — `readOnlyHint`, `destructiveHint`, `idempotentHint` and `openWorldHint` — and they describe what the worker actually does rather than what the slug's `.get`/`.post` suffix suggests. `openWorldHint` is true on every operation except two: upAPI is a marketplace, so nearly every operation exists to reach a system upAPI does not own. `text-analyze.post` and `email-generate-address.post` run entirely inside the worker and make no network call, so they declare `openWorldHint: false`. A tool's **name is not the slug**: MCP names have to be identifier-safe, so it is the operation id — the slug with dots and hyphens replaced by underscores. `github-trending.get` is the tool `github_trending_get`. The tool's description names the slug it maps to, and what a call costs, so you can cross-read these docs from a `tools/list` dump. Results come back as the operation's output object, JSON-encoded into a text block — no tool declares an `outputSchema`, and none returns `structuredContent`. That is deliberate: MCP obliges a server that declares an output schema to return matching structured content, and these outputs describe live third-party payloads, where one unexpected null would turn a successful call into a protocol error. Failures arrive with the [standard error code](https://upapi.io/docs/errors), which means an assistant can tell "you are out of quota" apart from "that operation does not exist" and say something useful about it. ## Cost [#cost] MCP tool calls are ordinary gateway calls: they consume the operation's [weighted units](https://upapi.io/docs/rate-limits) and count against the same monthly quota as your application traffic. Worth knowing before you point an agent at the catalog: an assistant exploring on its own can spend a lot more than a deliberate script, and the heaviest operations in the catalog cost 25 units per call. Check [`/api/usage`](https://upapi.io/docs/usage-api) after a long session, and keep an eye on the [quota notifications](https://upapi.io/docs/platform/notifications) at **25%, 50%, 75%, 90% and 100%**. --- # Plans and trials (https://upapi.io/docs/plans) Every number on this page is read at build time from `@upapi/plans`, the same module the pricing page and the billing system use. It cannot drift from what you are actually charged. ## Tiers [#tiers] | Plan | Price / month | Units / month | Requests / minute | Trial units | | --- | --- | --- | --- | --- | | Free | USD 0 | 1,000 | 10 | — | | Starter | USD 29 | 100,000 | 60 | 10,000 | | Pro | USD 99 | 500,000 | 300 | 50,000 | | Scale | USD 499 | 5,000,000 | 1,000 | 500,000 | "Units" are weighted — see [Rate limits](https://upapi.io/docs/rate-limits) for what an individual call costs. Quota is pooled across every key in your organization and resets at the start of each UTC calendar month. You only pay for calls we actually ran: requests we reject before running them, throttled calls, idempotent replays and cache hits all cost zero units. [What you are charged for](https://upapi.io/docs/rate-limits#what-you-are-charged-for) is the exact table. Plans also govern how many operations and products you may configure, and whether [hosted functions](https://upapi.io/docs/platform/hosted-functions) are available. ## Trials [#trials] Every paid tier starts with a **14-day free trial**. A trial is limited in time *and* in volume: it includes **10% of the tier's monthly units** for the whole trial, not per month. That second limit is the one to plan around. A trial is not simply "the paid plan for two weeks" — it is a bounded evaluation budget, sized so you can test the platform end to end before you are billed for anything. When either limit is reached the trial stops: time runs out, or the units do. Starting a trial means completing checkout, and checkout collects a payment method — the card is validated with a zero-amount authorisation and charged only when the trial converts. If you want to try upAPI without entering card details at all, use the **Free** tier above: it is a real, permanent plan with its own monthly units and no payment method on file. While a trial is live, `X-Trial-Units-Limit` and `X-Trial-Units-Remaining` appear on every gateway response and a `trial` block appears in [`/api/usage`](https://upapi.io/docs/usage-api). Both disappear once the trial ends. Spending the trial's units returns `429 QUOTA_EXCEEDED`, with `Retry-After` set to the time remaining until the trial ends. It is deliberately not `RATE_LIMITED`: no window refills here, so a client backing off on the burst code would retry until the trial expired. The trial budget belongs to the organization, and an organization can only trial once. Switching tiers mid-trial does not restart the clock or top up the units — the original end date and the cumulative budget both carry over, and the switch itself is free. ## Changing plan [#changing-plan] Billing lives at [Dashboard → Billing](https://app.upapi.io/dashboard/billing). Plan changes take effect immediately for rate limits and quota; you do not need to re-issue keys. You will get a [notification](https://upapi.io/docs/platform/notifications) when consumption crosses **25%, 50%, 75%, 90% and 100%** of your monthly quota, so a plan change is a decision rather than a surprise. --- # Quickstart (https://upapi.io/docs/quickstart) ## 1. Create an account [#1-create-an-account] Sign up at [app.upapi.io](https://app.upapi.io) with an email and password, or with Google or Apple. When guest access is enabled you can also explore the marketplace and the dashboard without an account at all, and convert to a real account later without losing what you created. Signing up creates your organization automatically. Keys, usage and billing all belong to that organization rather than to you personally, so inviting a teammate later does not mean re-issuing keys. ## 2. Create an API key [#2-create-an-api-key] Ask your agent to run `create_api_key` over the hosted MCP connection, or open the [API keys page](https://app.upapi.io/dashboard/api-keys), and create a key. It has the shape: ``` upapi_YOUR_KEY_HERE ``` That is the literal prefix `upapi_` followed by 48 hex characters — 54 characters in all. Only a SHA-256 hash of the key is stored, so nobody — including us — can show it to you again. Copy it when it appears. If you lose it, delete the key and create another. An organization can hold up to 20 keys, and can create up to 10 keys per hour. ## 3. Make a call [#3-make-a-call] Every operation is a `POST` to its slug on `api.upapi.io`, with the key in the `x-api-key` header and the input as a JSON body. ```bash title="GitHub trending repositories" curl -X POST https://api.upapi.io/github-trending.get \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'content-type: application/json' \ -d '{"language":"typescript","since":"weekly","limit":5}' ``` ```ts title="GitHub trending repositories" import { UpAPI } from '@upapi/sdk'; const upapi = new UpAPI({ apiKey: process.env.UPAPI_API_KEY }); const repos = await upapi.call('github-trending.get', { language: 'typescript', since: 'weekly', limit: 5, }); ``` ```python title="GitHub trending repositories" import os, requests repos = requests.post( 'https://api.upapi.io/github-trending.get', headers={'x-api-key': os.environ['UPAPI_API_KEY']}, json={'language': 'typescript', 'since': 'weekly', 'limit': 5}, ).json() ``` A successful call returns the operation's output directly — no envelope to unwrap: ```json { "language": "typescript", "since": "weekly", "totalCount": 5, "repos": [ { "position": 1, "fullName": "owner/repo", "url": "https://github.com/owner/repo", "description": "…", "language": "TypeScript", "totalStars": 48213, "starsToday": 612, "forks": 2140 } ], "fetchedAt": "2026-08-06T12:00:00.000Z" } ``` Operations with a required input reject an empty body. `pokeapi-pokemon.get` needs a `name`: ```bash curl -X POST https://api.upapi.io/pokeapi-pokemon.get \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'content-type: application/json' \ -d '{"name":"pikachu"}' ``` An operation's internal id may contain several dots (`pokeapi.pokemon.get`), but the callable slug collapses everything except the trailing method segment into hyphens — so you call `pokeapi-pokemon.get`. The marketplace and [`/api/catalog`](https://app.upapi.io/api/catalog) always show the callable form; use what they show. ## What to read next [#what-to-read-next] * [Authentication](https://upapi.io/docs/authentication) — how keys behave and what they scope to. * [Errors](https://upapi.io/docs/errors) — the one error shape, and every code behind it. * [Rate limits](https://upapi.io/docs/rate-limits) — burst limits, weighted units, response headers. * [TypeScript SDK](https://upapi.io/docs/sdk) — if you would rather not hand-roll `fetch`. --- # Rate limits (https://upapi.io/docs/rate-limits) Two independent limits apply to every call. **A per-minute burst limit** counts requests. It protects the platform from spikes and resets on a rolling 60-second window. **A monthly quota** counts *weighted units*, not requests. It is your actual budget, and it resets at the start of each UTC calendar month. Both are pooled across your whole organization. Creating more keys does not create more headroom. ## Weighted units [#weighted-units] Operations do not cost the same to run. A cached JSON lookup and a full search scrape land very differently on our side, so each operation carries a `unitWeight` and a call spends that many units. Across everything you can call today, a single request spends between **1 and 25 units**. | Units per call | What it covers | | --- | --- | | 1 | **Most operations** — A direct read: developer data, finance, news, weather, public profiles. More operations cost one unit than any other price. | | 2–6 | **Parse & extract** — A real processing step on top of the fetch — PDF text, image OCR, page-to-Markdown, Reddit and Maps reads. | | 10 | **Audio transcription** — GPU transcription, charged per call rather than per minute of audio. | | 15 | **Social via residential IPs** — Instagram, TikTok and LinkedIn reads. The residential proxies they need are what make them costly. | | 20 | **Browser rendering** — A real headless Chromium tab loading the page: screenshots and HTML-to-PDF. | | 25 | **Search results pages** — Google, Bing and DuckDuckGo results pages read in a real browser session, one page per call. Their upstream cost per read is the highest in the catalog. | Most of the catalog sits in the cheapest band, and the category name is not itself a signal — Bluesky and Mastodon cost the same as a weather lookup, while Instagram costs fifteen times more. A plan's monthly budget therefore goes as far as its unit count suggests only while you stay in that band. Each operation's weight is published as data, so you can price a workload before running it: the `metadata.unitWeight` field of each item in [`/api/catalog`](https://app.upapi.io/api/catalog), and the `OPERATIONS` array exported by the [TypeScript SDK](https://upapi.io/docs/sdk#inspecting-the-catalog). Every operation's page in the marketplace also shows its cost in the spec row beside the timeout and cache values. The gateway's weighting rules also cover kinds of work that are not published to anyone today. Treat the table above as a description of the current catalog rather than a fixed schedule, and read the weight from the catalog rather than assuming it from a category. ## Response headers [#response-headers] Every gateway response reports where you stand, so you never have to guess. | Header | Meaning | | ----------------------------- | ------------------------------------------------ | | `X-RateLimit-Limit` | Requests allowed per minute on your plan | | `X-RateLimit-Remaining` | Requests left in the current minute | | `X-RateLimit-Reset` | Unix seconds at which the minute window resets | | `X-RateLimit-Limit-Month` | Weighted units allowed this month | | `X-RateLimit-Remaining-Month` | Weighted units left this month | | `X-Trial-Units-Limit` | Total units included in your trial — trials only | | `X-Trial-Units-Remaining` | Trial units left — trials only | | `Retry-After` | Seconds to wait, on most 429s — see below | | `x-request-id` | Identifier for this call, on every response | | `x-upapi-cache` | `HIT` from cache; `MISS` or `BYPASS` executed | ### The standard `RateLimit` fields [#the-standard-ratelimit-fields] The same counters are also published in the IETF's standard form ([draft-ietf-httpapi-ratelimit-headers-11](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/)), so a client with a generic rate-limit layer can read them without knowing anything about upAPI: ```http RateLimit-Policy: "burst";q=10;w=60, "month";q=1000;w=2678400 RateLimit: "burst";r=9;t=57, "month";r=980;t=1209600 ``` Both are structured-field lists with one member per named policy: `q` is the quota per window, `w` the window in seconds, `r` what is left now and `t` the seconds until it resets. `burst` counts requests; `month` and `trial` count weighted units, the same numbers as the `X-RateLimit-*-Month` and `X-Trial-Units-*` headers. The `trial` policy appears only on a trial, exactly like its `X-` counterparts. Hosted-function compute is deliberately **not** in this list — it is metered in seconds of execution rather than in calls, so it would put a second currency behind one `r`; it keeps the `X-Compute-*` headers. The `X-RateLimit-*` headers are not deprecated and are not going away. Both sets describe the same counters and are sent together; read whichever suits your client. The two trial headers are absent when you are not on a trial. Treat their presence as the signal, rather than testing for a zero value. They are also absent from a **burst-throttle** 429 even while a trial is live: that rejection is decided before the trial budget is read, so it carries the minute and month counters but not the trial pair. A 429 that names the trial cap does carry them, with `X-Trial-Units-Remaining: 0`. Where `Retry-After` is sent it is honest about which limit you hit: 60 seconds for a burst throttle, the seconds remaining until the next UTC month for an exhausted monthly quota, and the seconds until your trial ends for a spent trial budget. Two 429s omit it — the hosted-function compute-quota rejection and a `SERVICE_BUSY` from a saturated isolate pool — so back off on your own schedule when it is missing rather than treating it as guaranteed. ## Which 429 you got [#which-429-you-got] Do not infer the limit from the size of `Retry-After`. The [error code](https://upapi.io/docs/errors#429-arrives-with-a-reason) says it outright: | Limit | Code | Waiting helps? | | ------------------------ | ---------------- | ------------------------------- | | Per-minute burst | `RATE_LIMITED` | Yes — 60 seconds | | Monthly weighted units | `QUOTA_EXCEEDED` | Only at the next UTC month | | Trial unit budget | `QUOTA_EXCEEDED` | Only when your paid plan starts | | Hosted-function compute | `QUOTA_EXCEEDED` | Only at the next UTC month | | Saturated execution pool | `SERVICE_BUSY` | Yes — back off and retry | ## Caching [#caching] Most operations declare a cache TTL, and a cached response arrives with `x-upapi-cache: HIT`. **A HIT costs zero units** — no operation ran, so there is nothing to charge for — which makes a cacheable operation cheaper the more repetitive your workload is. Sending a [custom proxy](https://upapi.io/docs/platform/proxies) disables caching for that call, because a response fetched through your egress IP is not interchangeable with one fetched through ours. Send `Cache-Control: no-cache` to skip the cached answer and get a fresh run, billed like any other call and answered `x-upapi-cache: BYPASS` (a 2xx result is still cached for the next caller). Some clients send this header on their own, for example Postman by default and Chrome with "Disable cache" open, so every repeat from them is billed at full weight. A cacheable operation that executes, built-in or your own user API (hosted functions are never cached), answers `x-upapi-cache: MISS` (or `BYPASS`), and only a successful result is cached. An operation that is not cacheable (no TTL, or a custom proxy in play) emits no header, and neither does a call the gateway refused or refunded as an error. Test for `=== 'HIT'`; never infer a miss from the absence of the header. ## What you are charged for [#what-you-are-charged-for] You only pay for calls we actually ran. A request we reject before running it — a validation error, an unknown operation, a bad key, a throttled call — costs zero units, and so does an answer served from cache or replayed from an `Idempotency-Key`. | Outcome | Units | | --------------------------------------------- | ---------- | | The operation ran (any status it returned) | Its weight | | `400` / `404` / `401` — refused before it ran | 0 | | `429` — throttled or out of quota | 0 | | `x-upapi-cache: HIT` | 0 | | `Idempotency-Replayed: true` | 0 | The one case worth reading twice: a `400` an **operation** returned is billed, because reaching it means the operation ran and validated your input itself. A `400` the gateway returned — a missing required field, a malformed body — is not, because nothing upstream was contacted. ## One behaviour that surprises people [#one-behaviour-that-surprises-people] ### The minute window extends on every attempt, including rejected ones [#the-minute-window-extends-on-every-attempt-including-rejected-ones] The per-minute counter's expiry is refreshed by every attempt, whether it was served or throttled. Hammering a throttled key therefore keeps it throttled: the window only clears after 60 seconds of complete silence on that key. If you are draining a backlog, back off properly when you see a 429 instead of retrying immediately, or spread the work across several keys and let each rest. ## Checking without calling [#checking-without-calling] [`GET /api/usage`](https://upapi.io/docs/usage-api) reports your current minute, month and trial position without spending anything. --- # TypeScript SDK (https://upapi.io/docs/sdk) `@upapi/sdk` is a small typed wrapper over the gateway. It has **no runtime dependencies** — it uses the platform's own `fetch` — so it adds essentially nothing to a bundle or a cold start. Node 20 or newer. ```bash npm install @upapi/sdk ``` ## Getting started [#getting-started] ```ts import { UpAPI } from '@upapi/sdk'; const upapi = new UpAPI({ apiKey: process.env.UPAPI_API_KEY }); const trending = await upapi.call('github-trending.get', { language: 'typescript', since: 'weekly', limit: 5, }); ``` `call(slug, input)` is the escape hatch: it works for any slug, including operations added after your installed version. For anything in the catalog, prefer the generated `operations` surface — it is keyed by slug and fully typed in both directions, so a wrong field name is a compile error rather than a `400` at runtime: ```ts const pokemon = await upapi.operations['pokeapi-pokemon.get']({ name: 'pikachu' }); // ^? PokeapiPokemonGetOutput ``` The typed surface lives on `upapi.operations[...]` and is indexed by the real slug — `upapi.operations['ip-geolocation.get']({ ... })`. There is no `upapi.ipGeolocationGet()` form. ### Client options [#client-options] ```ts const upapi = new UpAPI({ apiKey: process.env.UPAPI_API_KEY, baseUrl: 'https://api.upapi.io', // default timeoutMs: 60_000, // default retry: { retries: 2, maxRetryDelayMs: 60_000 }, // defaults idempotency: true, // default — see Idempotency below fetch: myInstrumentedFetch, // defaults to global fetch }); ``` `timeoutMs`, `retry`, `idempotency`, `idempotencyKey` and an `AbortSignal` can also be passed per call as a third argument, on both `call` and the `operations` methods. ## Reading quota as you go [#reading-quota-as-you-go] `callWithMeta` returns the metering context alongside the result, so you can pace yourself without waiting to be throttled: ```ts const { data, rateLimit, requestId, cached } = await upapi.callWithMeta('github-trending.get', { since: 'daily', }); rateLimit.monthlyRemaining; // weighted units left this UTC month rateLimit.remaining; // requests left in this minute cached; // true when the gateway served a cached upstream result requestId; // quote this in a support request ``` `rateLimit.trial` is present **only** while a trial is live, matching the gateway's own behaviour with the `X-Trial-Units-*` headers — feature-detect it rather than reading a zero. This is returned per call rather than stored on the client on purpose: a shared "last rate limit" field would be overwritten by whichever concurrent request happened to finish last, which is exactly when the number matters. ## Errors [#errors] There are **two** error types, and production code should handle both. ```ts import { UpAPI, UpAPIError, UpAPITimeoutError } from '@upapi/sdk'; try { await upapi.call('github-trending.get', { since: 'daily' }); } catch (err) { if (err instanceof UpAPIError) { err.code; // 'RATE_LIMITED' — branch on this err.status; // 429 err.retryAfterSeconds; // number | undefined err.requestId; // for support err.rateLimit; // where you stood when it failed err.isRateLimited; // status === 429 } else if (err instanceof UpAPITimeoutError) { // The request exceeded timeoutMs, or your AbortSignal fired. // Nothing came back, so there is no code and no status. } throw err; } ``` `code` is the same vocabulary documented in [Errors](https://upapi.io/docs/errors), so the handling you write for the SDK matches the handling you would write for raw HTTP. `PUBLIC_ERROR_CODES` and `PUBLIC_ERROR_STATUS` are re-exported if you want to switch exhaustively. A failure that never reached the gateway — an edge returning an HTML error page, say — has no error envelope to read, so `code` is `'UNKNOWN'` and `status` carries the real HTTP status. Always keep a default branch. ## Retries [#retries] The client retries **429 responses only**, up to `retry.retries` times (default 2\), waiting for the interval the gateway asked for in `Retry-After` and never sleeping longer than `maxRetryDelayMs`. That narrowness is deliberate. A 429 is the one failure the server has told you is worth repeating and exactly when. A `400` will never succeed on retry, and silently repeating a `502` can double-charge you for an operation that already did real upstream work. Set `retry: { retries: 0 }` to disable it, or wrap the call yourself for a broader policy — the SDK will not guess. Not every 429 is worth waiting for, and the client tells them apart by [error code](https://upapi.io/docs/errors#429-arrives-with-a-reason): `RATE_LIMITED` and `SERVICE_BUSY` are retried, `QUOTA_EXCEEDED` is surfaced immediately. A response with no recognizable code falls back to the older rule — retry unless `Retry-After` exceeds `maxRetryDelayMs` — so an out-of-date gateway still behaves sanely. A retried burst throttle still costs nothing: [throttled calls consume no units](https://upapi.io/docs/rate-limits). ## Idempotency [#idempotency] Every operation call carries an auto-generated `Idempotency-Key`, reused across this client's own retries. A retried call therefore replays the first attempt's result rather than running the operation — and being billed — a second time. The exception is an operation whose response is a live session, such as `wellfound-login` or `chatous-login`: upAPI never stores that response, so a retry after the first attempt finished runs the operation again and bills it again. The two Wellfound writes, `wellfound-apply` and `wellfound-send-message`, still replay, but a replay carries everything except the refreshed `session` and an `Idempotency-Redacted: session` header: reuse the session you already hold, and call `wellfound-login` again if Wellfound rejects it. See [Idempotency](https://upapi.io/docs/api#idempotency) for the server side. A field the gateway can remove from a replay is optional in the typed output (`session?: string`), and `callWithMeta` names the ones it did remove in `result.idempotencyRedacted`, an empty array when nothing was removed. ```ts const result = await upapi.callWithMeta('wellfound-apply.post', input); result.replayed; // true when the gateway replayed a stored response result.idempotencyRedacted; // ['session'] when the replay left out the refreshed session ``` Pass your own key when the unit of work belongs to your system rather than to this process, so a retry from another process or after a restart is still recognized as the same request: ```ts await upapi.call('reddit-post-comment.post', input, { idempotencyKey: `comment-${jobId}` }); ``` An explicit key is always sent. To stop sending generated ones, set `idempotency: false` on the client or on a single call. ## Checking usage [#checking-usage] ```ts const usage = await upapi.usage(); usage.remainingMonth; // weighted units left this month if ('trial' in usage) { usage.trial.unitsRemaining; } ``` This calls [`/usage`](https://upapi.io/docs/usage-api) and is free to poll — it is not metered and records no call. As with the header, the `trial` block is absent off-trial. ## Inspecting the catalog [#inspecting-the-catalog] The operation catalog ships with the package, so you can enumerate what a build supports without a network call: ```ts import { OPERATIONS, OPERATION_SLUGS } from '@upapi/sdk'; OPERATION_SLUGS; // readonly slug list // OPERATIONS is an ARRAY of metadata records, not a map keyed by slug. const op = OPERATIONS.find((o) => o.slug === 'github-trending.get'); op?.unitWeight; // weighted units per call op?.category; // 'Developer Tools' ``` `unitWeight` is the number of [weighted units](https://upapi.io/docs/rate-limits) one call spends, which makes it possible to price a workload before running it. This is the only place a per-operation weight is published as data you can rely on — the OpenAPI document does not carry it, and neither does `/api/catalog` when the engine is healthy. ## Staying in sync [#staying-in-sync] The typed operation list, the per-op types and the error vocabulary are all generated from the same registries that seed the live marketplace, and CI fails if they drift. An SDK release therefore describes exactly the operations that were live when it was cut: upgrading picks up new ones, and nothing silently disappears from under you. --- # Usage API (https://upapi.io/docs/usage-api) `GET /api/usage` reports where your organization stands in the current minute, the current month and — when one is running — the current trial. It is authenticated with the same API key as the gateway, and reading it costs no units. ```bash curl https://app.upapi.io/api/usage \ -H 'x-api-key: upapi_YOUR_KEY' ``` ```ts const usage = await fetch('https://app.upapi.io/api/usage', { headers: { 'x-api-key': process.env.UPAPI_API_KEY }, }).then((res) => res.json()); ``` ```python import os, requests usage = requests.get( 'https://app.upapi.io/api/usage', headers={'x-api-key': os.environ['UPAPI_API_KEY']}, ).json() ``` The endpoint is also reachable through the gateway host, which is convenient if your client is already configured for `api.upapi.io`: ```bash curl https://api.upapi.io/usage \ -H 'x-api-key: upapi_YOUR_KEY' ``` Operations are always `POST`. `/api/usage` is a platform endpoint rather than an operation, and it is a `GET`. It accepts an API key only — a browser session will not authenticate it. ## Response [#response] ```json { "plan": "Pro", "planSlug": "pro", "status": "ACTIVE", "rpmLimit": 300, "monthlyLimit": 500000, "usedThisMinute": 4, "usedThisMonth": 128340, "remainingMinute": 296, "remainingMonth": 371660, "units": { "used": 128340, "limit": 500000, "remaining": 371660 }, "resetAt": "2026-08-06T12:01:00.000Z", "hostedFunctions": { "used": 2, "limit": 15 }, "computeSeconds": { "used": 812, "limit": 50000 } } ``` | Field | Meaning | | ------------------------------------------------- | ----------------------------------------------------- | | `plan`, `planSlug` | Display name and slug of the active plan | | `status` | Subscription status — `FREE`, `TRIALING`, `ACTIVE`, … | | `rpmLimit`, `usedThisMinute`, `remainingMinute` | The per-minute burst window, counted in **requests** | | `monthlyLimit`, `usedThisMonth`, `remainingMonth` | The monthly budget, counted in **weighted units** | | `units` | The same monthly figures grouped together | | `resetAt` | When the current minute window rolls over | | `hostedFunctions` | Deployed functions against your plan's allowance | | `computeSeconds` | Hosted-function compute consumed this month | `usedThisMinute` is a raw request count. `usedThisMonth` and every `units` figure are weighted. A single Instagram call moves the first by 1 and the second by 15 — see [Rate limits](https://upapi.io/docs/rate-limits). ## The trial block [#the-trial-block] While a trial is live, one extra key appears: ```json { "trial": { "unitCap": 50000, "unitsUsed": 12800, "unitsRemaining": 37200, "endsAt": "2026-08-20T09:14:00.000Z" } } ``` When no trial is running, `trial` is **omitted entirely** rather than sent with zeroes. That is deliberate, so clients can feature-detect: ```ts const usage = await res.json(); if ('trial' in usage) { // On a trial: both the clock and the unit budget apply. showTrialBanner(usage.trial.unitsRemaining, usage.trial.endsAt); } ``` Testing `usage.trial.unitsRemaining > 0` without the guard throws off-trial. --- # Claude Code (https://upapi.io/docs/agent-setup/claude-code) **Onboard your AI agent to upAPI:** [Claude](https://claude.ai/directory/upapi), [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac97e64f7988191967fd96df23a0822), or add `https://app.upapi.io/api/mcp` (HTTP) to any other MCP client and sign in with your upAPI account. Paste this into Claude Code and it connects itself: ```text Connect upAPI to this agent. 1. Run: claude mcp add --transport http upAPI https://app.upapi.io/api/mcp 2. Then run /mcp, pick upAPI and choose Authenticate. A browser tab opens; sign in and click Allow access. 3. Call upAPI's search_tools and tell me what you can do. ``` Or do it by hand: ## Claude Code ### Hosted server (recommended) Signs in through a browser with OAuth, so no key is written anywhere. Needs a full upAPI account: a guest session is refused with `401 GUEST_FORBIDDEN`. 1. Run: ```bash claude mcp add --scope user --transport http upAPI https://app.upapi.io/api/mcp ``` 2. **User step:** In Claude Code, run `/mcp`, select `upAPI` and choose Authenticate. A browser opens to sign in to upAPI. No restart is needed. ### Local server (fallback) Use this only when the hosted server is not an option: a guest account, no browser on this machine, or the user asks for it. It runs `npx -y @upapi/mcp` on this machine and authenticates with `UPAPI_API_KEY`. The hosted server serves every public operation; the npm package catches up in its next release (the published 0.2.0 build serves the catalog without the account tools). 1. Run: ```bash claude mcp add --scope user upAPI --env UPAPI_API_KEY="$UPAPI_API_KEY" --env UPAPI_TOOL_MODE=compact -- npx -y @upapi/mcp ``` Check: `claude mcp list` shows `upAPI` as Connected (or Needs authentication until the user signs in). ## Verify Run `curl -sS https://api.upapi.io/usage -H "x-api-key: $UPAPI_API_KEY"`. Success is HTTP 200 and a JSON object with `plan`, `remainingMonth` and `units`. A 401 with the code `UNAUTHORIZED` means the key is wrong or was deleted: ask the user for a new one. A 403 `FORBIDDEN` naming the `usage:read` scope means the key is valid but was created as Execute only: it still calls operations, so keep it and tell the user this check could not read the quota. A 503 is an outage, not a bad key: wait and retry. Then call the `search_ops` tool with `{"query": "github repository stats"}`. Success is a list of operations that includes the slug `github-repo.get`. If the upAPI tools are not visible yet, the server is waiting for the user to finish the browser sign-in. --- # Codex (https://upapi.io/docs/agent-setup/codex) **Onboard your AI agent to upAPI:** [Claude](https://claude.ai/directory/upapi), [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac97e64f7988191967fd96df23a0822), or add `https://app.upapi.io/api/mcp` (HTTP) to any other MCP client and sign in with your upAPI account. Paste this into Codex and it connects itself: ```text Connect upAPI to this agent. 1. Run: codex mcp add upAPI --url https://app.upapi.io/api/mcp 2. Then run: codex mcp login upAPI A browser tab opens; sign in and click Allow access. 3. Call upAPI's search_tools and tell me what you can do. ``` Or do it by hand: ## Codex ### Hosted server (recommended) Signs in through a browser with OAuth, so no key is written anywhere. Needs a full upAPI account: a guest session is refused with `401 GUEST_FORBIDDEN`. 1. Run: ```bash codex mcp add upAPI --url https://app.upapi.io/api/mcp ``` 2. Run: ```bash codex mcp login upAPI ``` Opens a browser. The user finishes the upAPI sign-in there. ### Local server (fallback) Use this only when the hosted server is not an option: a guest account, no browser on this machine, or the user asks for it. It runs `npx -y @upapi/mcp` on this machine and authenticates with `UPAPI_API_KEY`. The hosted server serves every public operation; the npm package catches up in its next release (the published 0.2.0 build serves the catalog without the account tools). 1. Run: ```bash codex mcp add upAPI --env UPAPI_API_KEY="$UPAPI_API_KEY" --env UPAPI_TOOL_MODE=compact -- npx -y @upapi/mcp ``` Check: `codex mcp list` shows `upAPI`. ## Verify Run `curl -sS https://api.upapi.io/usage -H "x-api-key: $UPAPI_API_KEY"`. Success is HTTP 200 and a JSON object with `plan`, `remainingMonth` and `units`. A 401 with the code `UNAUTHORIZED` means the key is wrong or was deleted: ask the user for a new one. A 403 `FORBIDDEN` naming the `usage:read` scope means the key is valid but was created as Execute only: it still calls operations, so keep it and tell the user this check could not read the quota. A 503 is an outage, not a bad key: wait and retry. Then call the `search_ops` tool with `{"query": "github repository stats"}`. Success is a list of operations that includes the slug `github-repo.get`. If the upAPI tools are not visible yet, the server is waiting for the user to finish the browser sign-in. --- # Cursor (https://upapi.io/docs/agent-setup/cursor) **Onboard your AI agent to upAPI:** [Claude](https://claude.ai/directory/upapi), [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac97e64f7988191967fd96df23a0822), or add `https://app.upapi.io/api/mcp` (HTTP) to any other MCP client and sign in with your upAPI account. ## Cursor ### Hosted server (recommended) Signs in through a browser with OAuth, so no key is written anywhere. Needs a full upAPI account: a guest session is refused with `401 GUEST_FORBIDDEN`. 1. Edit `~/.cursor/mcp.json`. Create the file if it is missing. Otherwise add the `upAPI` entry to the existing `mcpServers` object and keep every other entry. ```json { "mcpServers": { "upAPI": { "url": "https://app.upapi.io/api/mcp" } } } ``` 2. **User step:** In Cursor's MCP settings, sign in on the `upAPI` entry (Cursor also asks the first time a tool is used). A browser opens to sign in to upAPI. ### Local server (fallback) Use this only when the hosted server is not an option: a guest account, no browser on this machine, or the user asks for it. It runs `npx -y @upapi/mcp` on this machine and authenticates with `UPAPI_API_KEY`. The hosted server serves every public operation; the npm package catches up in its next release (the published 0.2.0 build serves the catalog without the account tools). 1. Edit `~/.cursor/mcp.json`. Merge into `mcpServers` as above. `${env:UPAPI_API_KEY}` is Cursor's own interpolation, so the key stays out of the file. Cursor must be started from an environment where UPAPI_API_KEY is set. ```json { "mcpServers": { "upAPI": { "command": "npx", "args": [ "-y", "@upapi/mcp" ], "env": { "UPAPI_API_KEY": "${env:UPAPI_API_KEY}", "UPAPI_TOOL_MODE": "compact" } } } } ``` Check: Cursor Settings lists `upAPI` under MCP with its tools enabled. ## Verify Run `curl -sS https://api.upapi.io/usage -H "x-api-key: $UPAPI_API_KEY"`. Success is HTTP 200 and a JSON object with `plan`, `remainingMonth` and `units`. A 401 with the code `UNAUTHORIZED` means the key is wrong or was deleted: ask the user for a new one. A 403 `FORBIDDEN` naming the `usage:read` scope means the key is valid but was created as Execute only: it still calls operations, so keep it and tell the user this check could not read the quota. A 503 is an outage, not a bad key: wait and retry. Then call the `search_ops` tool with `{"query": "github repository stats"}`. Success is a list of operations that includes the slug `github-repo.get`. If the upAPI tools are not visible yet, the server is waiting for the user to finish the browser sign-in. --- # Agent setup (https://upapi.io/docs/agent-setup) **Onboard your AI agent to upAPI:** [Claude](https://claude.ai/directory/upapi), [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac97e64f7988191967fd96df23a0822), or add `https://app.upapi.io/api/mcp` (HTTP) to any other MCP client and sign in with your upAPI account. Copy this sentence into any AI coding agent. It fetches https://upapi.io/docs/agent-setup/prompt.md and sets everything up itself: ```text Fetch and execute the appropriate instructions to set me up for upAPI from https://upapi.io/docs/agent-setup/prompt.md ``` - [Claude Code](https://upapi.io/docs/agent-setup/claude-code) - [Codex](https://upapi.io/docs/agent-setup/codex) - [Cursor](https://upapi.io/docs/agent-setup/cursor) - [OpenCode](https://upapi.io/docs/agent-setup/opencode) - [VS Code](https://upapi.io/docs/agent-setup/vscode) ## What the agent does [#what-the-agent-does] The sentence points the agent at [prompt.md](https://upapi.io/docs/agent-setup/prompt.md), a plain Markdown file written for agents. Following it, the agent: 1. finds your API key in the environment, or asks you for one once and stores it in a git-ignored `.env`; 2. connects the upAPI [MCP server](https://upapi.io/docs/mcp) to itself, preferring the hosted server, which signs in through your browser; 3. installs the [TypeScript SDK](https://upapi.io/docs/sdk) if the project has a `package.json`; 4. verifies the key and the MCP connection with two calls that cost zero units; 5. tells you what it did and what is left for you. You are asked only for what an agent cannot do: a browser sign-in, or pasting a key. --- # OpenCode (https://upapi.io/docs/agent-setup/opencode) **Onboard your AI agent to upAPI:** [Claude](https://claude.ai/directory/upapi), [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac97e64f7988191967fd96df23a0822), or add `https://app.upapi.io/api/mcp` (HTTP) to any other MCP client and sign in with your upAPI account. Paste this into OpenCode and it connects itself: ```text Connect upAPI to this agent. 1. Add {"type":"remote","url":"https://app.upapi.io/api/mcp"} as "upAPI" under "mcp" in opencode.json 2. Then run: opencode mcp auth upAPI A browser tab opens; sign in and click Allow access. 3. Call upAPI's search_tools and tell me what you can do. ``` Or do it by hand: ## OpenCode ### Hosted server (recommended) Signs in through a browser with OAuth, so no key is written anywhere. Needs a full upAPI account: a guest session is refused with `401 GUEST_FORBIDDEN`. 1. Edit `~/.config/opencode/opencode.json`. Create the file if it is missing. Otherwise add the `upAPI` entry to the existing `mcp` object and keep everything else. ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "upAPI": { "type": "remote", "url": "https://app.upapi.io/api/mcp", "enabled": true } } } ``` 2. Run: ```bash opencode mcp auth upAPI ``` Opens a browser. The user finishes the upAPI sign-in there. ### Local server (fallback) Use this only when the hosted server is not an option: a guest account, no browser on this machine, or the user asks for it. It runs `npx -y @upapi/mcp` on this machine and authenticates with `UPAPI_API_KEY`. The hosted server serves every public operation; the npm package catches up in its next release (the published 0.2.0 build serves the catalog without the account tools). 1. Edit `~/.config/opencode/opencode.json`. Merge into `mcp` as above. `{env:UPAPI_API_KEY}` is OpenCode's own substitution, so the key stays out of the file. ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "upAPI": { "type": "local", "command": [ "npx", "-y", "@upapi/mcp" ], "enabled": true, "environment": { "UPAPI_API_KEY": "{env:UPAPI_API_KEY}", "UPAPI_TOOL_MODE": "compact" } } } } ``` Check: `opencode mcp list` shows `upAPI`. ## Verify Run `curl -sS https://api.upapi.io/usage -H "x-api-key: $UPAPI_API_KEY"`. Success is HTTP 200 and a JSON object with `plan`, `remainingMonth` and `units`. A 401 with the code `UNAUTHORIZED` means the key is wrong or was deleted: ask the user for a new one. A 403 `FORBIDDEN` naming the `usage:read` scope means the key is valid but was created as Execute only: it still calls operations, so keep it and tell the user this check could not read the quota. A 503 is an outage, not a bad key: wait and retry. Then call the `search_ops` tool with `{"query": "github repository stats"}`. Success is a list of operations that includes the slug `github-repo.get`. If the upAPI tools are not visible yet, the server is waiting for the user to finish the browser sign-in. --- # VS Code (https://upapi.io/docs/agent-setup/vscode) **Onboard your AI agent to upAPI:** [Claude](https://claude.ai/directory/upapi), [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac97e64f7988191967fd96df23a0822), or add `https://app.upapi.io/api/mcp` (HTTP) to any other MCP client and sign in with your upAPI account. ## VS Code ### Hosted server (recommended) Signs in through a browser with OAuth, so no key is written anywhere. Needs a full upAPI account: a guest session is refused with `401 GUEST_FORBIDDEN`. 1. Edit `.vscode/mcp.json`. VS Code uses `servers`, not `mcpServers`. Add the `upAPI` entry to an existing `servers` object and keep everything else. The file holds no secret, so it is safe to commit. ```json { "servers": { "upAPI": { "type": "http", "url": "https://app.upapi.io/api/mcp" } } } ``` 2. **User step:** In VS Code, open `.vscode/mcp.json`, click Start above the `upAPI` entry and allow the sign-in. A browser opens to sign in to upAPI. ### Local server (fallback) Use this only when the hosted server is not an option: a guest account, no browser on this machine, or the user asks for it. It runs `npx -y @upapi/mcp` on this machine and authenticates with `UPAPI_API_KEY`. The hosted server serves every public operation; the npm package catches up in its next release (the published 0.2.0 build serves the catalog without the account tools). 1. Edit `.vscode/mcp.json`. The key comes from a prompted input, never the file, because `.vscode/mcp.json` is usually committed. Merge into `inputs` and `servers` without dropping existing entries. ```json { "inputs": [ { "type": "promptString", "id": "upapi-key", "description": "upAPI API key", "password": true } ], "servers": { "upAPI": { "type": "stdio", "command": "npx", "args": [ "-y", "@upapi/mcp" ], "env": { "UPAPI_API_KEY": "${input:upapi-key}", "UPAPI_TOOL_MODE": "compact" } } } } ``` Check: The `upAPI` entry in `.vscode/mcp.json` shows Running. ## Verify Run `curl -sS https://api.upapi.io/usage -H "x-api-key: $UPAPI_API_KEY"`. Success is HTTP 200 and a JSON object with `plan`, `remainingMonth` and `units`. A 401 with the code `UNAUTHORIZED` means the key is wrong or was deleted: ask the user for a new one. A 403 `FORBIDDEN` naming the `usage:read` scope means the key is valid but was created as Execute only: it still calls operations, so keep it and tell the user this check could not read the quota. A 503 is an outage, not a bad key: wait and retry. Then call the `search_ops` tool with `{"query": "github repository stats"}`. Success is a list of operations that includes the slug `github-repo.get`. If the upAPI tools are not visible yet, the server is waiting for the user to finish the browser sign-in. --- # Hosted functions (https://upapi.io/docs/platform/hosted-functions) {/* TODO(P2-M16, 2026-10-19): this page, its URL (`/platform/hosted-functions`, linked from errors/index/plans/proxies) and the "hosted function" noun are the user-facing name of the `/api/user-functions` feature. Rename to "user functions" with a 301 only once the owner decides on the public noun. */} A hosted function is code you write, deployed to upAPI and invoked exactly like a marketplace operation: a `POST` to its slug with your API key. It runs in a V8 isolate — not a container — so cold starts are milliseconds rather than seconds. This is the escape hatch for the glue you would otherwise host yourself: reshape an operation's output, join two calls into one round trip, or wrap a private API of your own so the rest of your system only ever talks to upAPI. The Free tier's allowance is zero, and the gateway refuses to run a function with `403 FORBIDDEN` when your plan includes no compute. | Plan | Hosted functions | | --- | --- | | Free | Not included | | Starter | 3 | | Pro | 15 | | Scale | Unlimited | ## The execution context [#the-execution-context] Your function receives its validated input and a `ctx` object with two capabilities. **`ctx.fetch`** makes outbound HTTP requests. Every request passes an SSRF guard that resolves the target first and refuses private, loopback and link-local addresses — including through a redirect or a DNS record that changes between the check and the connection. A blocked request fails with `NETWORK_DENIED`. Each invocation may make at most 20 outbound requests, at most 5 of them concurrently, and each is capped at 30 seconds. **`ctx.secrets`** holds the secrets you attached to the function. They are encrypted at rest with AES-256-GCM and only decrypted inside the isolate for the duration of a call, so they are never part of your deployed code and never are never shown again after you save them. Deploy with `deploy_hosted_function`; `get_hosted_function` lists only the secret names. ## Limits [#limits] {/* Named headers, not two blank ``: empty header cells are an axe `empty-table-header` violation and leave a screen reader announcing each value with no idea what it is a value OF. Plain text rather than a visually-hidden `` because these pages have a Markdown twin (`/docs/platform/hosted-functions.md`, lib/get-llm-text.ts) — raw JSX inside a table cell survives into it verbatim, so an agent would read the markup instead of the header. */} | Limit | Value | | ----------------- | -------------------------------------------- | | Source size | 256 KB | | Execution timeout | Your plan's maximum, or lower if you set one | | Memory | 64 MB, 128 MB or 256 MB, by plan | | Response size | 1 MB | | Outbound requests | 20 per invocation, 5 concurrent | A function may declare a timeout below its plan's ceiling but never above it — the effective limit is whichever is smaller. Exceeding memory returns `MEMORY_EXCEEDED`: the request asked for more than the plan allows, so retrying it unchanged cannot help. Returning more than 1 MB fails with `INVALID_OUTPUT`. If you are producing large results, paginate or return a reference rather than the payload. A hosted function's errors reach you as an edge-safe 4xx rather than the code's usual status — `422` for `MEMORY_EXCEEDED`, `INVALID_OUTPUT` and `OPERATION_ERROR`, `408` for `OPERATION_TIMEOUT` — with the original in `X-Upapi-Execution-Status`. The body is also `{"error": "MEMORY_EXCEEDED", …}` with `error` as a **string**, not the usual `{ code, message }` object. See [Errors](https://upapi.io/docs/errors#hosted-function-failures-arrive-as-a-4xx-whatever-the-code-says). ## Metering [#metering] Hosted functions consume the same monthly units as any other call, plus compute seconds against your plan's allowance. Responses carry `X-Compute-Used` and `X-Compute-Remaining` so you can watch that budget from your client. Exhausting the compute allowance returns `429 QUOTA_EXCEEDED` and carries no `Retry-After`. The monthly unit quota and a trial's unit budget use that code too, so read the message to tell which budget is gone — compute is the only one that stops functions while marketplace operations keep working. Hosted functions are never served from cache and never routed through the [proxy pool](https://upapi.io/docs/platform/proxies) — `ctx.fetch` egresses directly. If you need a specific egress IP, make the request through a marketplace operation that supports proxying. ## Managing them [#managing-them] Create, edit and deploy functions from [Dashboard → Functions](https://app.upapi.io/dashboard/functions). Slugs are lowercase and may contain letters, digits, dots and hyphens, and must start with a letter or digit. --- # Notifications (https://upapi.io/docs/platform/notifications) The bell carries everything the platform needs you to know. Notifications also arrive as push on the installed mobile apps, and tapping one opens the page it refers to. ## Quota warnings [#quota-warnings] You are notified when your organization's consumption crosses **25%, 50%, 75%, 90% and 100%** of a monthly allowance: the month's API units, and the hosted-function compute seconds on plans that include them. * **Email**, to every owner and admin: at each of those marks, with one exception. The 25% email is sent only when 25% is reached in the first quarter of the month; later in the month it is not news. The 100% email says the allowance is used up and what that means: API calls are refused with `429 QUOTA_EXCEEDED` (for compute, hosted functions are paused and every other operation keeps running) until the count resets on the 1st, 00:00 UTC. * **The bell and push**, to every owner and admin, at 75%, 90% and 100%. Each mark fires **once** per month, no matter how many calls follow. A burst that jumps several marks at once sends only the highest one. Scale, the top plan, gets no usage alerts: there is no larger plan to move to. If you are on a [trial](https://upapi.io/docs/plans#trials), the trial's own unit budget is tracked separately and the bell warns at 75% and 90% of it. A trial can never reach the monthly marks of its plan, so without this it would get no warning at all before running out. ## Other notifications [#other-notifications] | Event | Who receives it | | ------------------------------------------------- | -------------------------- | | An API key was created | The person who created it | | A trial started, converted, or ended | The organization owner | | A subscription became active, or a payment failed | The organization owner | | A teammate accepted an invitation | The teammate and the owner | ## Turning them off [#turning-them-off] Change notification and push preferences with `update_notification_prefs`, `register_push_token` and `remove_push_token`, or on the settings page. Usage-alert emails have their own switch under Settings > Preferences, and every usage-alert email carries a link that turns them off. Quota warnings are worth keeping on: they are the only proactive signal before calls start failing with `429 QUOTA_EXCEEDED`. For a programmatic check instead of a notification, poll [`/api/usage`](https://upapi.io/docs/usage-api) — it reports the same position and costs no units. --- # Products (https://upapi.io/docs/platform/products) A product is a named bundle of operations. It is an organizational tool: when a workflow reaches for the same six operations every time, a product keeps them together instead of leaving you to rediscover the set. Products are created and managed at [Dashboard → Products](https://app.upapi.io/dashboard/products). How many you may create depends on your [plan](https://upapi.io/docs/plans). ## What a product does not change [#what-a-product-does-not-change] Bundling is presentational. It does not affect the call path, authentication, metering or limits: * You still call each operation at its own slug. * Cost is still per call, at each operation's own [unit weight](https://upapi.io/docs/rate-limits). * Nothing about a product grants or removes access to an operation. Every product is private to the organization that created it, and there is no control today for publishing one. If you need a public offering, that is not a feature that exists yet — do not design around it. ## What controls visibility [#what-controls-visibility] An operation's reach is set by its **publish targets**, not by any product it belongs to. An operation with no publish targets is hidden from the marketplace, the docs and the OpenAPI document, and returns `404 NOT_FOUND` at the gateway — the same response as a slug that was never created, so its existence is not disclosed. This is why an operation you can see in one place and not another is a publishing question rather than a permissions one. See [Errors](https://upapi.io/docs/errors#404-does-not-distinguish-missing-from-not-yours). --- # Proxies (https://upapi.io/docs/platform/proxies) Operations that fetch from third-party sites run through a proxy pool by default. You can override it per request, or configure a pool of your own for the whole organization. ## Per request [#per-request] Send the proxy URL in the `x-proxy-url` header: ```bash curl -X POST https://api.upapi.io/github-trending.get \ -H 'x-api-key: upapi_YOUR_KEY' \ -H 'x-proxy-url: http://user:pass@proxy.example.com:8080' \ -H 'content-type: application/json' \ -d '{"since":"daily"}' ``` The URL is validated before use — it must resolve to a public address, the same guard that protects [hosted functions](https://upapi.io/docs/platform/hosted-functions). A URL that fails validation returns `400 INVALID_INPUT` naming the reason, rather than silently falling back to the default pool. The header works on any operation. Some operations — most of the social-platform ones — *additionally* declare a `proxyUrl` field in their input schema, which their worker honours; the operation's marketplace page shows whether it does. The header is the portable choice, since it needs nothing from the schema. ## Per organization [#per-organization] You can also save a set of proxy URLs on your organization. When no `x-proxy-url` header is present, one of them is chosen at random for the call. A request header always wins over the pool. Organization proxies are validated when you save them, so a bad entry is caught at configuration time rather than on a call at three in the morning. ## Why it matters [#why-it-matters] The usual reason to bring your own proxy is **IP consistency across a chain of calls**. If a workflow logs in, then reads, then acts, having those steps arrive from three different addresses is what gets sessions flagged. Pinning one proxy for the chain keeps it coherent. Proxy cost is already included in the price of a call. There is no separate proxy bill, whether you use ours or your own. ## Two behaviours to design around [#two-behaviours-to-design-around] ### A custom proxy disables caching [#a-custom-proxy-disables-caching] Responses fetched through your proxy are never cached and never served from cache, so `x-upapi-cache` will not report a `HIT`. A response fetched from your egress IP is not interchangeable with one fetched from ours — geography and personalization both make it a different answer. Expect full latency and full upstream load on every proxied call. ### Hosted functions are not proxied [#hosted-functions-are-not-proxied] `ctx.fetch` inside a [hosted function](https://upapi.io/docs/platform/hosted-functions) egresses directly. `x-proxy-url` on a hosted-function call does not route its outbound requests. When you need a specific egress IP, call a marketplace operation that supports proxying instead of reimplementing the fetch in a function. --- # Status (https://upapi.io/docs/platform/status) ## Status page [#status-page] [app.upapi.io/status](https://app.upapi.io/status) shows the current health of every component the gateway depends on — the execution engine, the operation catalog, the datastore and the cache. ## Status endpoint [#status-endpoint] [`GET /api/status`](https://app.upapi.io/api/status) returns the same report as JSON, uncached. ```bash curl -i https://app.upapi.io/api/status ``` It needs no authentication. `/api/status` answers **200 only when everything is operational**. Any degraded component or outage returns **503**. You can therefore point an uptime monitor at the URL and let it treat the HTTP status as the verdict, without parsing the body. That behaviour is intentional and worth relying on: it exists because an outage where the catalog silently emptied returned a cheerful 200 for hours. A partial degradation is a real failure, so it is reported as one. The endpoint is designed never to throw. If the health checks themselves cannot run, it reports everything as down rather than returning a 500 — the safe direction to fail for a monitor. ## When something is wrong [#when-something-is-wrong] Failures at the gateway carry an `x-request-id` on the response. Include it when you [get in touch](https://upapi.io/docs/platform/support) — it identifies your exact call. If the status page is green but your calls are failing, the code in the [error envelope](https://upapi.io/docs/errors) tells you which layer to look at: `UPSTREAM_*` means the third-party service an operation wraps, not the platform. --- # Support (https://upapi.io/docs/platform/support) Support requests go through [app.upapi.io/support](https://app.upapi.io/support). The form works **without being signed in**, which is deliberate — a login problem is a support request, and a support channel you can only reach after logging in is useless to the people who most need it. If you are signed in, your account email is filled in for you. ## What to include [#what-to-include] The more of this you supply, the faster the answer: * **The `x-request-id`** from the failing response. Every gateway response carries one and it identifies your exact call in our logs. This is the single most useful thing you can send. * **The error `code`** from the [envelope](https://upapi.io/docs/errors) — not just the HTTP status. `RATE_LIMITED`, `QUOTA_EXCEEDED` and `SERVICE_BUSY` are all `429` and have completely different answers. For a `QUOTA_EXCEEDED`, include the message too: it names which budget is gone — the month's units, a trial's, or compute. * **The operation slug** and the input you sent, with any secrets removed. * **Roughly when it happened**, with a timezone. ## Before you write [#before-you-write] A few checks answer most questions immediately: * [Status](https://upapi.io/docs/platform/status) — is a component degraded right now? * [`/api/usage`](https://upapi.io/docs/usage-api) — have you run out of units, or of trial budget? * [Errors](https://upapi.io/docs/errors) — several codes mean something other than what their status suggests. A `503` on a keyed call is an outage, not a bad key; `MEMORY_EXCEEDED` is a client error you receive as a `422`; a `404` may mean an operation exists but is not published to you.