GroqCloud API
Fast OpenAI-compatible inference on GroqCloud: chat, streaming, tool use, strict JSON schemas, Whisper transcription, TTS and batch jobs.
AI & machine learningGuided#groq#llm#chat#openai-compatible#speech-to-text#function-calling#gpt-oss
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
GroqCloud runs open-weight models (OpenAI's GPT-OSS, Meta's Llama, Qwen and others) on Groq's own LPU inference hardware, built for very fast token generation and low latency. The API is OpenAI-compatible: the same Chat Completions and Responses request bodies, the same SDKs, a different base URL. On top of chat it offers tool use, structured outputs, Whisper speech-to-text, Orpheus text-to-speech and a discounted Batch API.
Get an API key
- Sign up or log in to the GroqCloud console.
- Open API Keys and create a key. Copy it when it is shown.
- Paste it into the apiKey variable of this collection (it is marked secret, so it is never shared when you fork or publish).
- Check your plan's limits on the Limits page; upgrade your plan in the console's billing settings when you need higher limits.
Authentication
Send Authorization: Bearer <your key> on every request; this collection does it for you.
Base URL: https://api.groq.com/openai/v1 (OpenAI SDKs: set base_url / baseURL to it).
Models
The model variable defaults to openai/gpt-oss-120b, the featured production model with reasoning, tool use, strict structured outputs and built-in browser search. openai/gpt-oss-20b is faster and cheaper with the same features; llama-3.3-70b-versatile and llama-3.1-8b-instant are non-reasoning production models. Speech uses whisper-large-v3 / whisper-large-v3-turbo, and text-to-speech the preview canopylabs/orpheus-* models. Preview models can be withdrawn at short notice; check Supported models and Deprecations.
How to use this collection
- 1. Start here: list models and send a first chat completion.
- 2. Chat and 4. Structured output: system prompts, reasoning effort, streaming, JSON.
- 3. Tool use: run step 1 then step 2 (IDs are passed automatically), or let the model search the web.
- 5. Responses API and 6. Speech are single requests.
- 7. Batch runs in order: upload, create, check, download.
Common errors
| Status | Meaning | What to do |
|---|---|---|
| 400 | Bad request | Invalid body or a value the model does not support (e.g. a reasoning_effort level, n other than 1). |
| 401 | Unauthorised | Missing or invalid API key. |
| 403 | Forbidden | Your key or plan does not allow this resource. |
| 404 | Not found | Wrong path or a retired/misspelled model ID. |
| 413 | Too large | Request body (often an audio file) is too big; use url for audio. |
| 422 | Unprocessable | Well-formed request the model could not complete; retry or adjust the prompt. |
| 429 | Rate limited | Wait for retry-after seconds; watch the x-ratelimit-* headers. |
| 498 | Flex capacity exceeded | The flex service tier is full; retry later or use on-demand. |
| 500 / 502 / 503 | Server error | Retry with backoff; server errors are not billed. |
Limits and pricing
Pricing is per million input and output tokens for chat models, per hour of audio for Whisper and per character for text-to-speech; batch jobs cost half. Rate limits (requests and tokens per minute and per day) depend on the model and your plan, and are reported in x-ratelimit-* response headers. See Pricing, Rate limits, Errors and the API reference.
Endpoints 19
1. Start here
- GETList models
/modelsLists every model currently active on GroqCloud: chat models, Whisper speech-to-text, text-to-speech and safety models. Each entry has the id to use in model,… - GETRetrieve a model
/models/{{model}}Returns one model object for the ID in the model variable: id, owned_by, active and context_window. A 404 means the ID is wrong or the model was retired. Note… - POSTCreate a chat completion
/chat/completionsGroqCloud is OpenAI-compatible: POST /openai/v1/chat/completions takes the same body as OpenAI's Chat Completions, so OpenAI SDKs work by changing the base…
2. Chat
- POSTSystem prompt and reasoning effort
/chat/completionsA system message sets the behaviour for the conversation. On reasoning models you can tune how much they think: Lower effort means fewer reasoning tokens, so… - POSTMulti-turn conversation
/chat/completionsThe API keeps no history: send the whole conversation each time, alternating user and assistant messages, with the new user turn last. Trim old turns when the… - POSTStream the answer (SSE)
/chat/completionsSet "stream": true to receive chat.completion.chunk events as data-only Server-Sent Events while tokens are generated; each chunk's choices[0].delta.content…
3. Tool use
- POST1) Offer a tool
/chat/completionsList your functions in tools ({"type": "function", "function": {name, description, parameters}}, up to 128). The model replies with finish_reason:… - POST2) Send the tool result back
/chat/completionsRun the function, then resend the conversation with: 1. the assistant message that holds the tool_calls (rebuilt here from toolCallId and toolCallArgs), and… - POSTBrowser search (built-in tool, Responses API)
/responsesGPT-OSS models on Groq can search the web themselves with the built-in browser_search tool, through the Responses API (POST /openai/v1/responses). You do not…
4. Structured output
- POSTStructured output (strict JSON schema)
/chat/completionsresponse_format: {"type": "json_schema", "json_schema": {name, schema, strict}} makes the answer follow your schema. Structured Outputs cannot be combined… - POSTJSON object mode
/chat/completionsresponse_format: {"type": "json_object"} returns syntactically valid JSON without enforcing a shape; it works on models without strict schema support. Say in…
5. Responses API (beta)
- POSTCreate a response
/responsesGroq's Responses API (beta) accepts OpenAI's Responses format at POST /openai/v1/responses: send model and input (a string or message items), optionally…
6. Speech
- POSTTranscribe an audio file
/audio/transcriptionsUpload audio as multipart/form-data (pick the file in the body tab) and get the text back. Audio is billed by duration, with a minimum of 10 seconds per… - POSTTranscribe audio from a URL
/audio/transcriptionsInstead of uploading, pass a public url to the audio file. This is the way to transcribe files larger than the upload limit. Here verbose_json returns… - POSTText to speech (Orpheus)
/audio/speechTurns up to 200 characters of text into speech with Canopy Labs' Orpheus models (preview models: they may change or be withdrawn at short notice). What comes…
7. Batch
- POST1) Upload the batch file
/filesA batch input is a .jsonl file, one chat completion request per line, each with a unique custom_id, method, url and body: {"custom_id": "req-1", "method":… - POST2) Create a batch
/batchesStarts the job. What comes back: a batch object with status: "validating". The test saves its id into batchId. - GET3) Check the batch
/batches/{{batchId}}Poll until status is final: validating, in_progress, finalizing, then completed, failed, expired or cancelled. request_counts shows progress. When it is… - GET4) Download the results
/files/{{batchOutputFileId}}/contentReturns the output .jsonl: one line per request with your custom_id and a response holding status_code and the normal chat completion body. Match lines by…
API details
- Base URL
https://api.groq.com/openai/v1- Authentication
- A bearer token in the Authorization header
- Operations
- 19 operations on 19 pathsPOST 15GET 4
- Main resources
- 1. Start here 32. Chat 33. Tool use 34. Structured output 25. Responses API (beta) 16. Speech 37. Batch 4
- Description format
- Swastik Codes guided collection, API version
checked against the docs on 2026-11-17 - Links
- Documentation
How to test the GroqCloud API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the GroqCloud API collection, without the publisher's secrets.
- Add your credentialsThis API uses A bearer token in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “List models” (GET /models), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the GroqCloud API?
Fast OpenAI-compatible inference on GroqCloud: chat, streaming, tool use, strict JSON schemas, Whisper transcription, TTS and batch jobs. It is listed under AI & machine learning and has 19 endpoints.
Who publishes the GroqCloud API?
It is listed from Groq's public API description (an OpenAPI document), not published by Groq on Swastik Codes. Anyone who controls groq.com can claim the profile by adding a DNS TXT record.
What is the base URL of the GroqCloud API?
Requests go to https://api.groq.com/openai/v1. Endpoint paths are added to this base URL.
How do I authenticate with the GroqCloud API?
With A bearer token in the Authorization header.
How many endpoints does the GroqCloud API have?
19 operations on 19 paths (15 POST, 4 GET). The largest groups are 1. Start here, 2. Chat, 3. Tool use, 4. Structured output.
Is forking the GroqCloud API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.