APITube Help Center

Test keys vs live keys

How APITube test keys and live keys differ — content, quota, rate limits — and when to use each

Kent Hudson

Written by Kent Hudson

June 28, 2026

Updated July 6, 2026

Open this example in the API Playground ↗

Test keys vs live keys

Every APITube account has two kinds of API key. A test key (prefix api_test_) calls the same live endpoints and returns the real response structure, but article content is truncated and no quota or balance is spent. A live key (prefix api_live_) returns full article content and draws down your plan quota or pay-as-you-go balance. The prefix is the only difference the API looks at — there is no separate test environment or sandbox URL.

# Same endpoint, same shape — only the key's prefix changes the behaviour
curl "https://api.apitube.io/v1/news/everything?per_page=10&api_key=api_test_YOUR_TEST_KEY"

Use a test key to build and verify an integration for free — pagination, field selection, filters and error handling all behave exactly as they will on a live key. Switch to a live key on a paid plan when you need the full article body.

How do you tell a test key from a live key?

By the prefix, and nothing else. Keys are issued as a prefix plus a long random string:

  • api_live_… — a live key.
  • api_test_… — a test key.

There is no is_test flag stored in the database; the API decides the mode purely by reading the start of the key value on every request. Both kinds authenticate the same three ways — an Authorization: Bearer token, an X-API-Key header, or an api_key query parameter (see how to authenticate your API requests).

Every response also echoes the mode in a header so your client never has to parse the key:

x-apitube-mode: test
x-apitube-mode: live

What does a test key return differently?

A test key hits the live API and gives you the genuine JSON structure — the same fields, the same arrays, the same error codes — so your parsing code is exercised for real. What changes is the content inside that structure. Test keys mask article data the same way the Free plan does:

  • The article body and description are cut to the first 200 characters, followed by a note of how many characters are hidden and the marker [Test mode — use a live key for full content].
  • The href and image are truncated to a short stub plus that same marker.
  • The source domain is shortened too.

Aggregate endpoints are limited in the same spirit so test keys can’t reveal the real archive volume: /v1/news/count returns a capped number (no more than 100), and /v1/news/trends returns the structure but hides the trending value. Streaming works as well — both the SSE stream and the WebSocket feed deliver the real event flow with the body masked and no quota consumed. If you see placeholder text where the article body should be, you are using a test key — see why your results are masked.

Do test keys count against my quota or rate limit?

Test keys never touch your quota. They do not decrement your plan requests, your streaming points or your pay-as-you-go balance, and they never hit the 402 “no points” wall — so you can hammer them during development without burning anything.

They are, however, rate-limited more strictly than live keys, because the live endpoints they call are real:

  • Test keys: up to 15 requests per minute.
  • Live keys: up to 50 requests per minute.

Both share the same abuse guard: after 30 violations the key is temporarily banned (HTTP 429). Build your retry and back-off logic against a test key first, then it will already be correct when you move to live traffic.

How do you create or switch between test and live keys?

Both kinds are created in the APITube dashboard. Flip the Test mode toggle at the bottom of the sidebar, then open API Keys and click Create key — a key made in test mode starts with api_test_, and a key made in live mode starts with api_live_. Test and live keys are listed separately per mode, so toggling the switch shows the set for whichever mode you are in. You can hold several of each and revoke any of them (see how to create, rename and revoke API keys).

The full credential reference also lives on the official authentication page on docs.apitube.io.

Common Questions

Can I use a test key in production?

No. A test key returns truncated article content, so the data is only useful for wiring up and validating an integration, not for serving real results. It is also rate-limited more tightly (15 requests per minute). For production traffic, create a live key on a paid plan to receive full content.

Do test keys respect IP, referrer and scope restrictions?

Yes. The same access checks run on every request regardless of mode. If you add an IP allow-list, a domain (referrer) restriction or endpoint scopes to a test key, the API enforces them and returns 403 (ER0601 for IP, ER0602 for referrer, ER0603 for scope) when a call falls outside them — exactly as it would for a live key.

Can a test key expire?

Yes. If you set an expiry date on a key, it applies whether the key is test or live. Once the date passes, the API rejects the key with 401 ER0230 before doing any work.

Does my code need to change when I switch from test to live?

No code changes — only the key value. Because a test key returns the same endpoints, parameters and response structure as a live key, swapping api_test_… for api_live_… is enough to start receiving full content. The only behavioural differences disappear automatically: content is no longer truncated, the rate limit rises to 50 requests per minute, and requests begin drawing down your quota or balance.


Related Articles