Make your first API request
Create a key, check the free model catalog, send one paid Responses request, and find its activity.
Create a key, check the free model catalog, send one paid Responses request, and find its activity.
Set BASE_URL to your HTTPS API origin without a trailing slash or /v1, and pass API_KEY from your credential store. OpenAI-compatible SDKs use ${BASE_URL}/v1; Anthropic-compatible SDKs use BASE_URL.
You need an UnlimGPT account with API access and available credits. The catalog check is free. The generation request can consume credits; review the current rate and balance first.
Open API keys, create a named organization key, choose an expiry, review its displayed default permissions, and save the value in a trusted credential store. Keep it out of source files, shell history, URLs, and support messages. If the key is lost, create a replacement and revoke the old key.
On the API keys page, copy the root address shown as the Anthropic base URL. If you copy the OpenAI base URL instead, remove its final /v1. Enter that HTTPS origin without a trailing slash as BASE_URL; the same root works for every example here, including image requests.
For this short test, enter the address and then the key at a masked prompt in the shell that will run the examples. Do not replace the key prompt with a command containing the key. In Bash or Zsh:
printf 'API base URL: '
read -r BASE_URL
export BASE_URL
printf 'API key: '
read -rs API_KEY
printf '\n'
export API_KEY
In PowerShell 7.1 or newer:
$env:BASE_URL = Read-Host "API base URL"
$env:API_KEY = Read-Host "UnlimGPT API key" -MaskInput
Both variables are available to child processes in this terminal session. The Bash/Zsh requests below pass the authorization header to curl through standard input; -q ignores personal curl settings. Do not use a shared terminal for this test; clear the key variable after the final request.
printf 'Authorization: Bearer %s\n' "$API_KEY" \
| curl -q -i -H @- "$BASE_URL/v1/models"
Expect HTTP 200 and a JSON data array. Each entry has a canonical id; a display name is not a request ID. An empty list or 403 means you need to check account access before a paid request. Choose an id your key can see. The examples below use gpt-5.6-sol; replace it if needed.
PowerShell 7.1 or newer:
$baseUrl = $env:BASE_URL
$parameters = @{
Uri = "$baseUrl/v1/models"
Headers = @{ Authorization = "Bearer $env:API_KEY" }
SkipHttpErrorCheck = $true
}
$models = Invoke-WebRequest @parameters
$models.StatusCode
$models.Content | ConvertFrom-Json
printf 'Authorization: Bearer %s\n' "$API_KEY" \
| curl -q -i -H @- "$BASE_URL/v1/responses" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-sol",
"input": "Say hello in one sentence.",
"max_output_tokens": 64,
"stream": false,
"store": false
}'
Expect HTTP 200, a request-id header, and a JSON response with status: "completed", a resp_… ID and visible output. The words are generated and will vary. This first request explicitly sets store: false, so its result cannot later be fetched by ID; safe activity and accounting metadata are still recorded. For a retriable application request, generate and retain a unique idempotency key as shown in idempotency and retries.
PowerShell 7.1 or newer:
$baseUrl = $env:BASE_URL
$payload = @{
model = "gpt-5.6-sol"
input = "Say hello in one sentence."
max_output_tokens = 64
stream = $false
store = $false
}
$body = $payload | ConvertTo-Json -Compress
$parameters = @{
Method = "Post"
Uri = "$baseUrl/v1/responses"
Headers = @{ Authorization = "Bearer $env:API_KEY" }
ContentType = "application/json; charset=utf-8"
Body = $body
SkipHttpErrorCheck = $true
}
$result = Invoke-WebRequest @parameters
$result.StatusCode
$result.Headers["request-id"]
$result.Content | ConvertFrom-Json
Open API Activity for the same organization. Find the recent operation by endpoint, time and outcome. Its row ID is a run ID, different from the HTTP request-id header. The usage guide explains the tokens and debit on the Activity screen; do not turn an outcome into a money price. If the call fails, keep only the HTTP request ID and public error code for support; never send the key or prompt. Errors and limits explains the next action.
When finished, run unset API_KEY in Bash or Zsh, or Remove-Item Env:API_KEY in PowerShell. This clears the current shell variable; revoke the API key separately if you no longer need it.