curl --request POST \
--url https://api.hopscotchlabs.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-4o-mini",
"input": "Say hi in five words."
}
'import requests
url = "https://api.hopscotchlabs.ai/v1/responses"
payload = {
"model": "openai/gpt-4o-mini",
"input": "Say hi in five words."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'openai/gpt-4o-mini', input: 'Say hi in five words.'})
};
fetch('https://api.hopscotchlabs.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hopscotchlabs.ai/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'openai/gpt-4o-mini',
'input' => 'Say hi in five words.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hopscotchlabs.ai/v1/responses"
payload := strings.NewReader("{\n \"model\": \"openai/gpt-4o-mini\",\n \"input\": \"Say hi in five words.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hopscotchlabs.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"openai/gpt-4o-mini\",\n \"input\": \"Say hi in five words.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopscotchlabs.ai/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"openai/gpt-4o-mini\",\n \"input\": \"Say hi in five words.\"\n}"
response = http.request(request)
puts response.read_bodyCreate a model response
Send a request in the OpenAI Responses format. Set stream: true for server-sent events.
This is the same door as chat completions: the same key, the same catalog, the same hold against your balance and the same usage row, filed under its own endpoint family so a charge is recognisable. The body is forwarded as you sent it, with one exception documented on store below.
Credit is held when the request is admitted and settled against the provider’s own token counts when it finishes. You are charged the provider’s rate at face value. Nothing is added per request.
curl --request POST \
--url https://api.hopscotchlabs.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-4o-mini",
"input": "Say hi in five words."
}
'import requests
url = "https://api.hopscotchlabs.ai/v1/responses"
payload = {
"model": "openai/gpt-4o-mini",
"input": "Say hi in five words."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'openai/gpt-4o-mini', input: 'Say hi in five words.'})
};
fetch('https://api.hopscotchlabs.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hopscotchlabs.ai/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'openai/gpt-4o-mini',
'input' => 'Say hi in five words.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hopscotchlabs.ai/v1/responses"
payload := strings.NewReader("{\n \"model\": \"openai/gpt-4o-mini\",\n \"input\": \"Say hi in five words.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hopscotchlabs.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"openai/gpt-4o-mini\",\n \"input\": \"Say hi in five words.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopscotchlabs.ai/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"openai/gpt-4o-mini\",\n \"input\": \"Say hi in five words.\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
A workspace API key in an Authorization: Bearer header. A missing header, a scheme other than Bearer, a key of the wrong shape, and a key we reject are all 401.
Body
The model to call, which the live catalog has to offer for the responses family. A provider-pinned id, {provider}/{that provider's own id}, is split once on the first slash. A routing-profile slug, profile/{identifier}, tries that profile's models in your own order. hopscotch/auto names whichever route your workspace made its default. A bare model id is refused with 400 and the code model_id_not_pinned. GET /v1/models lists the exact strings this key can call.
"openai/gpt-4o-mini"
The Responses API input, forwarded opaquely: a string, or the array of typed input items the API accepts.
Server-sent events instead of one JSON body.
This platform stores no response, so only false is accepted. Omitting the field is served and nothing is forwarded in its place, so the provider applies its own default. An explicit true is refused before admission, naming this field.
false Response
The model response, in the Responses format, forwarded as the provider sent it.
When stream is true the body is text/event-stream instead, and the token counts arrive on a :x-hopscotch-usage comment line immediately before the stream ends; the server-sent events specification requires parsers to ignore comment lines, so an SDK never sees it.