Templates · AI
OpenAI API collection template
Responses, Chat Completions, embeddings, images and moderation with the OpenAI API.
What's inside
The main OpenAI endpoints: generate text with the Responses API or Chat Completions, create embeddings, generate an image, check content with moderation and list the models your key can use. Change model in the environment to try another one.
6 requests in 4 folders · Base URL https://api.openai.com/v1 · Bearer token
Set it up
- Open OpenAI API in Requestarium (or in the app: Import, Start from a template) and import it. You get the collection and a "OpenAI API" environment.
- Create a secret key at platform.openai.com/api-keys. Requests are billed to your OpenAI account.
- Fill in the environment, pick it in the environment menu and send the first request.
Environment variables
| Variable | What it is |
|---|---|
openaiApiKeysecret | Secret key, sk-… |
model | Model for text requests; "List models" shows what your key can use. |
Requests
Text
- POSTCreate a response
/responsesThe Responses API.
- POSTCreate a chat completion
/chat/completionsChat Completions with a system and a user message.
Embeddings and moderation
- POSTCreate embeddings
/embeddingsA vector for search and clustering.
- POSTModerate text
/moderationsFlags harmful content.
Images
- POSTGenerate an image
/images/generationsAnswers with a base64 image.
Models
- GETList models
/modelsModels your key can use; a quick way to check the key.