API Playground

Experiment with OpenAI models, tweak parameters, and inspect responses with tokens & cost estimates.

Live API playgroundInteractive ยท Ready

Playground Controls

Request

JSON
Loading...

Response

JSON
No response yet.

Token Usage & Cost

Run a request to view token details.

import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const response = await client.chat.completions.create(
  {
  "model": "gpt-5.2",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ]
}
);

console.log(response);