oktools

Online API Client

Send HTTP requests from your browser, like a lightweight Postman: query parameters, headers, JSON, form and file bodies, Bearer, Basic, API key and OAuth 2.0 auth, and environments with {{variables}}. Import an OpenAPI or Swagger spec to get a request for every endpoint with responses checked against it, or bring in a Postman collection or a curl command. Requests go straight from your browser to the API, and nothing is stored.

Request

https://jsonplaceholder.typicode.com/posts?userId=1&_limit=5

Query parameters

Write a path parameter in the URL as {id} and a variable as {{name}}.

Response

No response yet

Press Send, or Ctrl+Enter, to send the request straight from your browser.

What a browser-based API client can and cannot do

TopicIn this client
CORS The API must allow requests from this site with Access-Control-Allow-Origin. Without it the browser blocks the response, which a desktop client such as Postman never has to ask for.
Headers you send Anything except the ones browsers reserve: Cookie, Host, Origin, Referer, Content-Length and a few more.
Headers you see The standard ones, plus those the API lists in Access-Control-Expose-Headers. Set-Cookie is never visible.
http:// addressesOnly localhost: an https page cannot call other plain http:// APIs.
Bodies None on GET or HEAD requests; JSON, text, XML, form, multipart and file bodies otherwise.
Storage None. Everything lives in this tab until it is closed; export to a Postman file to keep it.

How it works

A request here is a plain object — method, a URL with {name} path parameters, query parameters, headers, a body and an auth setting — and before anything is sent it becomes what fetch() will receive. {{variables}} are filled from the collection and then from the active environment, which wins; path values are percent-encoded into the URL; the query table is appended; auth becomes an Authorization header, an API key header or a query parameter; and the body is encoded for its mode, with Content-Type added where the mode implies one. The line under the URL shows the result, and the Code tab shows it as curl or fetch().

The request is sent by the browser itself, with fetch() in cors mode, straight to the host you named: oktools.dev is never on the path. The server has to allow this origin with Access-Control-Allow-Origin, and a method other than GET or a header beyond the simple ones makes the browser send an OPTIONS preflight first. When the server does not allow it, the browser reports nothing but failure, so the response panel lists the likely causes and the console holds the exact reason. Whatever the browser would refuse — a body on GET, a Cookie header, an http:// address from this https page — is caught before Send.

Importing an OpenAPI or Swagger document runs it through the same checks as the OpenAPI validator page, then turns each operation into a request: the first server becomes {{baseUrl}}, parameters take their example, default or first enum value, a JSON body is written from the request schema with every documented property, and the security schemes become collection auth with {{token}} or {{apiKey}} placeholders to fill in once. Each imported request remembers its operation, so after Send the response status is looked up among the documented ones and a JSON body is validated against the schema for its media type, in the spec’s own dialect.

Examples

Turn a curl command into a request

The command is split the way a shell would split it, including the $'…' strings Chrome writes in Copy as cURL. The authorization header becomes the Bearer auth setting, the query string moves into the parameters table and the JSON body sets its own Content-Type, so that header is not kept twice. --compressed is a curl concern and is dropped.

curl
curl 'https://api.example.com/v1/items?page=2' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer tok123' \
  -H 'content-type: application/json' \
  --data-raw '{"name":"Desk lamp","price":49.9}' \
  --compressed
Request
Name: POST /v1/items
Method: POST
URL: https://api.example.com/v1/items
Params: page = 2
Headers: accept: application/json
Auth: Bearer token tok123
Body (JSON): {"name":"Desk lamp","price":49.9}

See the request as curl before sending it

This is the sample collection’s Create a post request as the Code tab writes it: {{baseUrl}} is filled in, the Content-Type the JSON mode adds is written out, and the body is quoted for a shell, so the command runs as it is in a terminal. The fetch() version is one click away.

Request
POST {{baseUrl}}/posts
baseUrl = https://jsonplaceholder.typicode.com
Headers: Accept: application/json
Body (JSON):
{
  "title": "Hello",
  "body": "Sent from oktools.dev",
  "userId": 1
}
Code tab, curl
curl -X POST https://jsonplaceholder.typicode.com/posts \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "title": "Hello",
  "body": "Sent from oktools.dev",
  "userId": 1
}'

Catch what the browser would refuse

The first two lines are errors and keep Send disabled; the third is a warning, meaning the request would go but not quite as written. These are rules of the Fetch standard rather than of this page, which is why Postman, a desktop program, never shows them.

Request
GET http://api.example.com/items
Headers: Cookie: session=abc
Body (JSON): {"a":1}
Before sending
This page is served over https, so the browser blocks requests to plain http:// addresses other than localhost. Use the API’s https:// address.
Browsers cannot send a body with a GET request. Change the method, or set the body to None.
The browser does not let a page set Cookie, so it is left out.

Check a response against the imported spec

The request was imported from a spec whose GET /things documents a 200 response as an array of objects with a required integer id and a required string name. The Spec check tab names each mismatch by its path in the body; a 404 from the same operation would instead be reported as not documented.

Response body
[
  { "id": 1, "name": "Lamp" },
  { "id": "x" }
]
Spec check
The body does not match the documented 200 schema.
$[1].name is required but missing
$[1].id must be integer, got string

Supported formats

  • BodiesJSON, plain text and XML with their Content-Type set for you, URL-encoded forms, multipart forms with text and file fields, or a single file, on any method except GET and HEAD.
  • AuthenticationBearer token, Basic with UTF-8 credentials, an API key in a header or the query string, and OAuth 2.0 with the authorization code grant plus PKCE, client credentials or password; set once on the collection and inherited, or overridden per request.
  • ImportsOpenAPI 3.0 to 3.2 and Swagger 2.0 in YAML or JSON, pasted, opened as a file or fetched by URL; Postman v2.1 collections and environments; a curl command with its headers, body, -u Basic auth, Bearer header and -F form fields. The kind of input is recognised from how it starts.
  • ExportsThe collection or an environment as a Postman v2.1 file, which Postman, Insomnia, Bruno and Hoppscotch open, with secret-looking variables blanked unless you tick the box; any single request as a curl command or a fetch() call.
  • ResponsesJSON pretty-printed with 64-bit integers kept exact, HTML and images previewed, text shown up to 2 MB and any body downloaded whole; the headers shown are the ones CORS lets a page see.

Use cases

  • Try an endpoint from its documentationPaste the curl example a vendor’s docs give, put a test key in, and read the real response shape before writing the client code.
  • Walk a whole API from its specImport the OpenAPI file, fill in baseUrl and token once, and send each operation in turn to find where the implementation and the document disagree, with the mismatches named by path.
  • Reproduce a bug seen in the browserCopy the failing request from the network tab as cURL, import it, change one header or field at a time and resend, with the history keeping each attempt.
  • Hand a request to a colleagueBuild it here and copy it as curl, or export the collection as a Postman file, so they get the exact method, URL, headers and body rather than a description of them.
  • Check the CORS setup of your own APIA request that succeeds from here proves the preflight and Access-Control headers are right for a browser client; one that fails tells you which header is missing.

Limitations

  • CORS cannot be bypassedThe API must allow https://oktools.dev or *; there is no proxy to route around a server that does not. For one you do not control, run the request from the Code tab in curl or a desktop client.
  • Browser-reserved headersCookie, Host, Origin, Referer, Content-Length and the other forbidden headers are dropped with a warning, and Set-Cookie is never visible in a response. The curl export writes them anyway, since curl has no such rule.
  • Plain http:// only to localhostAn https page cannot call other http:// addresses, so an internal API without TLS needs a local tunnel or a desktop client.
  • Nothing is savedThe collection, environments, tokens and history live in the tab and go with it; export before closing. There is no sync, sharing or team workspace.
  • No scripts, chaining or other protocolsPostman pre-request and test scripts are not run, and a value from one response cannot feed the next request automatically; paste it into a variable. There are no WebSocket, gRPC or GraphQL-specific views either, though a GraphQL query is just a POST with a JSON body.

Frequently asked questions

How do I send an API request online?

Pick a method, type the URL and press Send, or Ctrl+Enter. Query parameters, headers, a JSON, form, multipart or file body, and auth each have a tab under the URL; a query string pasted into the URL moves into the parameters table on its own. The response shows its status, time and size, with the body formatted as JSON, as raw text, or previewed as an image or an HTML page. Variables written as {{name}} are filled in from the collection or the active environment, and the line under the URL shows exactly what will be sent before you send it.

Why does my request fail here when it works in Postman or curl?

Almost always CORS. Postman and curl are programs on your computer, but this client is a web page, and a browser only lets a page read a response from another site when that site allows it with an Access-Control-Allow-Origin header. Public APIs often do; internal and third-party APIs often do not. When the browser blocks a request it tells the page nothing more than that it failed, so the message lists the likely causes and the browser console (F12) has the exact one. If the API is yours, allowing https://oktools.dev in its CORS settings makes it work. A browser also will not let a page set Cookie, Host, Origin or Referer headers, or call a plain http:// address other than localhost from an https page.

Can I import an OpenAPI or Swagger spec and try its endpoints?

Yes. Paste the spec, open the file or fetch it by URL under Import / export, and every operation becomes a request, in a folder per tag. The first server becomes a {{baseUrl}} variable, path and query parameters are filled with the spec's examples, a JSON body is written from the request schema, and auth is set up from the security schemes, with {{token}} or {{apiKey}} variables to fill in once. Each response is then checked against the spec: whether its status code is documented, and whether a JSON body matches the documented schema, with every mismatch named by its path.

Can I import a Postman collection or a curl command?

Both. A Postman v2.1 collection keeps its folders, requests, variables and auth, and a Postman environment becomes an environment you can switch to; pre-request and test scripts are not run. A curl command — such as one copied from the browser's network tab with "Copy as cURL (bash)" — becomes a request with its method, headers, body and Basic or Bearer auth. The Code tab goes the other way, writing any request as a curl command or a JavaScript fetch() call.

Is anything I enter saved or sent to oktools.dev?

No. The collection, environments, tokens and history live only in this tab's memory: nothing is written to localStorage, IndexedDB or a cookie, and a reload starts over from the sample. To keep your requests, export them as a Postman file, with secrets left out unless you tick the box. Requests travel straight from your browser to the API you name and never pass through oktools.dev. Because this page, like any web page, also runs a third-party analytics script, use test or short-lived credentials here rather than production secrets.

Which authentication methods does it support?

Bearer tokens, Basic auth, API keys in a header or the query string, and OAuth 2.0 with the authorization code flow (always with PKCE), client credentials or a username and password. For the authorization code flow, register https://oktools.dev/oauth-callback.html as a redirect URL with your provider: sign-in happens in a popup, and the token is held in this tab only. Auth can be set once on the collection and inherited by every request, or overridden on any one of them.

Can it call an API running on localhost?

Yes, as long as the local server answers CORS requests from https://oktools.dev. Browsers allow an https page to call http://localhost, but not other plain http:// addresses, and Chrome asks once for permission before a public site may reach your own machine or local network. Requests use your browser's own network connection, so a VPN or corporate network your browser is on is reachable too.