Playground
Send a real request. See what came back, and what it cost.
No account, no sign-in, no sample data. Paste your Penstoke key, send a completion or call any endpoint, and read the figures off the response the gateway just gave you — the cost of that one call, the tokens, which provider served it, and how much of the wait was the network.
Want a conversation rather than one request? The AI playground streams a multi-turn chat and totals what the thread costs. No key yet? A trial takes a minute and needs no card.
Held in this page's memory and nowhere else. It is not saved in your browser, never put in the URL, and sent to nothing but the gateway named beside it — the request goes straight from here to that host, not through penstoke.com. Reload the page and it is gone.
Change it for your own domain, your account's own address, or a deployment you run yourself. https only, except localhost.
Nothing sent yet
What comes back goes here: the completion itself, then every figure the gateway reports about the call that made it, then the response verbatim.
The figures, when there are some
- Status HTTP status line
- Round trip Measured in your browser
- Gateway latency X-Gateway-Latency-Ms
- Cost X-Gateway-Cost-Usd
- Tokens usage in the response body
- Provider X-Gateway-Provider
- Model served X-Gateway-Model
- Cache X-Gateway-Cache
- Fallback X-Gateway-Fallback
- Dry run X-Gateway-Dry-Run
- Request id X-Request-Id
Each one is explained under What every figure means below. None of them is shown here as a worked example, because an invented figure on this page would be worth less than no figure at all.
What this page actually does
Penstoke is one API in front of the AI models, storage buckets and push services an app uses. The AI gateway is OpenAI-compatible, so your existing SDK only changes its base URL; the storage gateway signs uploads so provider credentials never reach a client; the push gateway reaches installs through APNs and FCM. All three sit behind one key and one audit trail, and a plan caps what you configure rather than what you send. This page is the shortest way to find out whether all of that is true.
- Your key, not ours
- There is no shared demo key and no sandbox account. The call is made with the key you paste, on your provider accounts, against your budgets — which is the only way a figure on this page could mean anything.
- Straight from your browser
- The request goes from this tab to the gateway, cross-origin, with no cookies and nothing in between. It is not proxied through penstoke.com: your key never touches our frontend, and the call is byte for byte the one your own code will make.
- Two latencies, not one
- The gateway reports how long it took; this page measures how long you waited. The difference is the network between you and the gateway, and folding them into one number would be a claim about both that is true of neither.
- Errors are the interesting part
- A wrong key, a missing scope, an exhausted budget, a provider that fell over. Each one comes back with the gateway's own message, verbatim, and a sentence saying what it means — because this is the surface you will meet at three in the morning.
- Nine endpoints, which is all of them
- Everything an API key reaches, across the AI, storage and push gateways, each with a body its schema accepts. Nothing else is reachable here on purpose: this is a playground for one API, not a browser-based HTTP client.
- Its sibling is a conversation
- This page sends one request and takes the answer apart. The AI playground keeps talking: multi-turn chat, streamed as it is written, with each turn's cost and a running total for the thread. Same key, same rules about where it is held, different question answered.
- Copyable as curl
- Every request is shown as the shell command that would do the same thing, with your key as $PENSTOKE_KEY rather than pasted in. It is the same call, ready for your notes or a colleague.
What every figure means
Each one is read from the response you just got: a header the gateway set, a field in the body, or a clock in this browser. Where the gateway sent nothing, the panel shows a dash — never a zero, because a zero would claim the call was free or instant.
- StatusHTTP status line
- What the gateway decided, before any of the rest of it. 200 means it ran; 401 means the key was not recognised; 403 means the key is real but carries no scope for that path; 429 is a rate limit or an exhausted budget; 502 means your provider failed, not the gateway.
- Round tripMeasured in your browser
- performance.now() either side of the whole exchange — from sending to having the body in hand — so it includes DNS, TLS, the distance between you and the gateway, and the provider call. It is always larger than the gateway's own figure, and the difference is the network you are on.
- Gateway latencyX-Gateway-Latency-Ms
- How long the gateway itself took, measured server-side across the provider call. Absent on a streamed response, because the headers are written before the provider has finished.
- CostX-Gateway-Cost-Usd
- What that one call cost, priced on the model that actually served it and trimmed to eight decimal places. It is in a header rather than a monthly report because a tenth of a cent is a real figure at a million calls, and because the number is only useful while you still remember which request it belonged to.
- Tokensusage in the response body
- prompt_tokens, completion_tokens and total_tokens, exactly as the OpenAI shape defines them. Present on completions, and on nothing else.
- ProviderX-Gateway-Provider
- Which configured provider served the call — the thing an alias deliberately does not make your app name.
- Model servedX-Gateway-Model
- The model that answered, which is not always the one you asked for: an alias resolves to a different id, and a fallback resolves to another one again.
- CacheX-Gateway-Cache
- HIT when the answer came from the gateway's cache, MISS when it went to the provider, BYPASS when caching did not apply.
- FallbackX-Gateway-Fallback
- Present only when the primary model failed and the call moved down the alias's ordered list to reach one that answered.
- Dry runX-Gateway-Dry-Run
- True when the provider has no real credentials configured. The request is validated, priced and logged, and nothing leaves the gateway — so the completion is generated rather than answered.
- Request idX-Request-Id
- The id of this exact request in the gateway's own logs. It is the thing to quote when asking anybody what happened.
- Retry afterRetry-After
- Seconds to wait, sent with a rate limit. It is a real instruction rather than a suggestion: retrying sooner earns the same answer.
Why the cost of a call belongs in a header
Most model spend is discovered at the end of the month, as one figure for everything, by which time nobody can say which feature earned it. The useful moment for the cost of a call is the moment the call returns — while you still have the prompt in front of you, the request id in your hand, and the ability to decide the answer was not worth it.
So the gateway prices each call against the model that actually served it and puts the result on the response, to eight decimal places, next to which provider answered and how long the provider took. Your code can read it, log it, bill it on, or refuse to make the call again. No report to wait for and no reconciliation to do.
The same information is written to the gateway's own log for every request, which is where a month's worth of it gets totalled per endpoint and per day. The header is not a replacement for that; it is the part of it that is worth having immediately.
Two of the headers this page reads are newer than most deployments — X-Gateway-Latency-Ms and X-Gateway-Cost-Usd. A gateway that has not been updated yet simply does not send them, and the panel shows a dash where each would go rather than inventing one. If you see dashes there and figures everywhere else, that is what it means.
A streamed response has no cost or latency header either, and for a good reason: those headers are written before the provider has finished speaking, so at that moment neither figure exists. The gateway omits them rather than sending a zero that would read as free and instant. This page sends stream: false so that both figures are there to see. The AI playground takes the other side of that trade — it streams, shows time to first token instead, and says which turns are missing from its cost total rather than counting them as nothing.
Cost is also the one figure that is still true on a dry run. A provider configured without real credentials never calls anybody, and the request is still validated, priced and logged — which is how you can wire an integration end to end before a single key exists.
Every endpoint an API key reaches
Nine routes across the three gateways, and that is the complete list. Each one is selectable in the playground above, with its path filled in and a body its schema accepts. Everything else on the host authenticates with a session instead, which is why a key cannot reach it and why this page will not try.
AI gateway
OpenAI-compatible. Aliases, ordered failover, budgets, cost per call.
- GET /v1/modelsScope ai
- Lists the models and aliases this key can reach. It calls no provider, spends nothing, and answers with what the key is actually allowed to ask for — the shortest honest test that a key works.An AI endpoint key (gw_ai_…) or a general key (gw_sk_…) with the ai scope.
- POST /v1/chat/completionsScope ai · writes
- The OpenAI-compatible completion. `model` may be a routing alias, a provider-qualified id such as openai/gpt-4o-mini, or auto for the endpoint's default. What it wants: Nothing, if the endpoint has a default model. This is a real call on your provider account, so it costs what that provider charges.An AI endpoint key (gw_ai_…) or a general key (gw_sk_…) with the ai scope.
Storage gateway
Presigned URLs and path-to-bucket routing. Credentials never reach a client.
- POST /storage/v1/presignScope storage
- Signs a URL for one object, at the bucket your routing rules send that path to. Provider credentials stay on the gateway; the answer names the bucket, the provider and when the signature expires. What it wants: A path your routing rules cover. A PUT presign also needs contentType and sizeBytes, because both are signed into the URL.A general key (gw_sk_…) with the storage scope.
- POST /storage/v1/resolveScope storage
- Says which rule matched a path, which bucket and provider it resolves to, and whether a fallback would be used — without signing anything or touching the provider. What it wants: Any path. A path no rule matches is a real answer too: it comes back as the default bucket, or as nothing configured.A general key (gw_sk_…) with the storage scope.
- POST /storage/v1/uploads/completeScope storage · writes
- Confirms a presigned upload. The object is verified at the provider and then indexed, which is what makes it appear in the dashboard with its real size. What it wants: The path of an object you have just uploaded with a presigned PUT. Nothing is there to verify otherwise.A general key (gw_sk_…) with the storage scope.
Push gateway
APNs and FCM. Topics, or registered devices by platform and tag.
- POST /push/v1/devicesScope push · writes
- Registers one install so it can be targeted by platform or tag later. Topic broadcasts need no registration at all, which is why an app can ship without ever calling this. What it wants: An FCM or APNs token from a real install, at least 8 characters. Platform is IOS, ANDROID or WEB.A push app key (gw_push_…), which is bound to one app.
- POST /push/v1/eventsScope push · writes
- Records that a delivered notification was opened. Idempotent: a second call for the same message answers recorded: false rather than counting the open twice. What it wants: The 24-character id of a message that app was actually delivered. Anything else is rejected by the schema before it reaches a database.A push app key (gw_push_…), which is bound to one app.
- POST /push/v1/sendScope push:send · writes
- Sends immediately to at most 1000 devices of one app, and answers with how many APNs and FCM accepted. Targets can also be deviceIds, tags or platforms, combined with AND. What it wants: Your push app id and one device token. This one really sends: unless that app is in dry run, a notification arrives on the device whose token you paste. It is prefilled with a single token rather than a platform for exactly that reason.A general key (gw_sk_…) with the push:send scope — never a push app key, which ships inside client apps.
- DELETE /push/v1/devices/:tokenScope push · writes
- Unregisters one install, which is what an app calls when somebody turns notifications off. The token is in the path, not a body. What it wants: Replace :token in the path with the device token. That device stops receiving targeted sends.A push app key (gw_push_…), which is bound to one app.
What this page does with your key
It is pasted into a field, held in the page's memory, and used as the Authorization: Bearer header of the request you send. That is the whole of it. It is not written to localStorage or sessionStorage, never put in the URL — this page cannot read a key out of a query parameter, so a link to it can never carry one — and never sent to penstoke.com. Reloading the tab loses it, which is the right trade for a credential typed into a public web page.
The request itself goes from your browser to https://api.penstoke.com — or to whichever base URL you put in its place — cross-origin and with cookies switched off. There is no server of ours in the path. That is partly so the key cannot be logged anywhere by us, and partly because a direct call is the honest demonstration: it is exactly the request your own code will make.
A key still deserves the usual care. Use one scoped to the thing you are testing, and rotate it afterwards if you would rather not have typed it in a browser at all — every key can be revoked on its own from the dashboard without touching the others.
Playground questions
- Do I need an account to use the playground?
- No account and no sign-in. The page runs in your browser and calls the gateway directly with a key you paste into it. You do need a key, and a key comes from an account — but if you have not got one, the page still shows you the exact request shape, the curl that would send it, every endpoint a key reaches, and what each figure in a response means. Nothing is gated and nothing is fabricated to fill the gap.
- Is my API key stored anywhere?
- No. It is held in the page's memory for as long as the tab is open and nowhere else: not in localStorage, not in sessionStorage, never in the URL, and never sent to penstoke.com. The request goes straight from your browser to the gateway host you name, cross-origin and without cookies, so the key reaches the gateway and nothing else. Reload the page and it is gone. The curl block writes it as $PENSTOKE_KEY rather than the pasted value, so a copied command carries no credential.
- Does it cost anything to run a request here?
- A completion does, yes — and it should be said plainly: it is a real call on your own provider account with your own key, so that provider bills you at its rates and the call counts against whatever budget the endpoint has. Penstoke meters nothing and marks nothing up. GET /v1/models costs nothing at all, because it calls no provider; it only answers with what the key is allowed to reach. A provider configured without real credentials costs nothing either, and the answer comes back stamped as a dry run.
- Which models can I use?
- Whichever ones that key is allowed to reach, which is a question only the gateway can answer: run GET /v1/models and it lists the routing aliases and provider models for that key. In the model field you can write an alias you defined, a provider-qualified id such as openai/gpt-4o-mini, or auto for the endpoint's default. The response then tells you which model actually served the call, because an alias or a fallback may well have resolved to a different one.
- Can I test the storage and push gateways here too?
- Yes. All nine API-key routes are listed and selectable, each prefilled with a body its schema accepts: presign, resolve and upload-complete on the storage gateway, and device registration, open events, direct send and unregister on the push gateway. They need the right kind of key — storage takes a general gw_sk_ key with the storage scope, device endpoints take a push app key, and a direct send takes push:send. One warning worth repeating: a direct send really sends, so it is prefilled to target a single device token you paste rather than a whole platform.
- What is the difference between this and the AI playground?
- The shape of what they do. This page is a request inspector: one of the nine endpoints an API key reaches, one request, one result, taken apart header by header — which is what you want when the question is whether a key, a scope, a path or a body works. The AI playground is a conversation: only the chat endpoint, called once per message, streamed token by token, with each turn's cost, time to first token and tokens beside it and a running total for the thread — which is what you want when the question is what talking to a model through the gateway actually costs. Both are public, both run in your browser on a key you paste into them, both hold that key in the page and nowhere else, and the figures mean the same thing on each.
- Why can I only call /v1, /storage/v1 and /push/v1?
- Because those are the only paths the gateway answers from another origin. They authenticate with API keys rather than session cookies, so they carry Access-Control-Allow-Origin: * and expose their X-Gateway-* headers for a browser to read. Everything else on the host needs a session, and a browser could not read the response even if it sent the request. The restriction is also deliberate: this is the Penstoke playground, not a general HTTP client with somebody else's credentials in it.
It costs a minute to find out whether this fits.
Start free trial14 days, no card. Make a key, bring it back here, and send something through it.