OpenAI API Tester

Build, run and copy OpenAI Chat Completions API requests as cURL, Python and JavaScript.

Building the request and the cURL, Python and JavaScript code happens locally in your browser. When you press Run, your OpenAI API key and prompt are sent directly from your browser to OpenAI — not to ArrayKit. Your key is kept in browser memory only and is never stored or sent to ArrayKit. Avoid using production keys on shared or public machines.

Test the Claude API

About OpenAI API Tester

The OpenAI API Tester lets you build, run and copy OpenAI Chat Completions requests without leaving your browser. Paste your OpenAI API key, pick a model like gpt-4o or gpt-4o-mini, set max tokens, and write a prompt — the tool assembles a valid POST to https://api.openai.com/v1/chat/completions and generates ready-to-use cURL, Python and JavaScript snippets. Where CORS allows, press Run to send the request directly from your browser to OpenAI and inspect the raw JSON response. It is built for developers checking that a new key works, prototyping a prompt, debugging a 401 or rate-limit error, or copying a tested request straight into their app. The request and code are constructed locally in the browser; your key is only used to call OpenAI when you choose to run it.

Features

How to use the OpenAI API Tester

  1. Paste your OpenAI API key (sk-…) into the key field
  2. Pick or type a model such as gpt-4o-mini and set max tokens
  3. Write your prompt in the prompt box
  4. Press Run to send the request and read the JSON response
  5. Open the cURL, Python or JavaScript tab and copy the code

Common errors & troubleshooting

Frequently asked questions

What is the OpenAI API Tester?
It is an ArrayKit tool that builds an OpenAI Chat Completions request from your key, model and prompt, lets you run it where CORS allows, and gives you copy-ready cURL, Python and JavaScript for the same call.
Is my OpenAI API key safe to paste here?
The request and code are built locally in your browser. When you press Run, your key and prompt are sent directly from your browser to OpenAI, never to ArrayKit, and the key is kept in browser memory only — it is not stored or sent to ArrayKit. Avoid using production keys on shared machines.
Why does Run sometimes fail when the cURL works?
Browsers enforce CORS, so a direct browser call can be blocked even when the request is valid. Copy the generated cURL or Python and run it from a terminal or backend instead.
Which models can I test?
Any Chat Completions model your account can access. The tool suggests gpt-4o, gpt-4o-mini, gpt-4-turbo, o1-mini and gpt-3.5-turbo, and you can type any other model name.
Can I get Python and JavaScript code, not just cURL?
Yes. Switch between the cURL, Python and JavaScript tabs to copy the exact same request in your preferred language.
Does the tool store my prompts or responses?
No. The prompt is used to build and run the request; ArrayKit does not store your prompts, keys or responses on a server.

Related tools

All ArrayKit tools