List models
curl --request GET \
--url https://api.hopscotchlabs.ai/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hopscotchlabs.ai/v1/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hopscotchlabs.ai/v1/models', 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/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hopscotchlabs.ai/v1/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hopscotchlabs.ai/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopscotchlabs.ai/v1/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "openai/gpt-4o-mini",
"object": "model",
"created": 1756080000,
"owned_by": "openai",
"hopscotch": {
"model_id": "openai/gpt-4o-mini",
"display_name": "GPT-4o mini",
"author": "openai",
"context_window_tokens": 128000,
"max_output_tokens": 16384,
"input_rate_thousandths": 150,
"output_rate_thousandths": 600,
"currency_code": "USD",
"endpoint_families": [
"chat_completions"
],
"provider_display_names": [
"OpenAI"
],
"capabilities": {
"audio": "no",
"json_mode": "yes",
"streaming": "yes",
"tools": "yes",
"vision": "yes"
}
}
}
]
}{
"error": {
"message": "Incorrect API key format. A Hopscotch key looks like ub_live_ followed by 43 characters. Check you have not pasted a key from another provider.",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key",
"request_id": "REQUEST_ID"
}
}{
"error": {
"message": "POST is not supported for /v1/models in this release.",
"type": "invalid_request_error",
"param": null,
"code": "method_not_allowed",
"request_id": "REQUEST_ID"
}
}{
"error": {
"message": "Rate limit reached for this key. Try again in 12 seconds. Request id REQUEST_ID.",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded",
"request_id": "REQUEST_ID"
}
}{
"error": {
"message": "The server had an error while processing your request. Sorry about that! Quote the request id if you contact support.",
"type": "api_error",
"param": null,
"code": null,
"request_id": "REQUEST_ID"
}
}{
"error": {
"message": "No provider is configured, so there is nothing to serve this request.",
"type": "api_error",
"param": null,
"code": "no_provider_configured",
"request_id": "REQUEST_ID"
}
}Models
List models
List the models you can call. The id of each entry is what you send as model.
Each entry is the OpenAI model object with a hopscotch block beside it, carrying what OpenAI’s own object has no field for: who serves the model, what it can do, its context window, and the provider’s list price.
GET
/
v1
/
models
List models
curl --request GET \
--url https://api.hopscotchlabs.ai/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hopscotchlabs.ai/v1/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hopscotchlabs.ai/v1/models', 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/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hopscotchlabs.ai/v1/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hopscotchlabs.ai/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopscotchlabs.ai/v1/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "openai/gpt-4o-mini",
"object": "model",
"created": 1756080000,
"owned_by": "openai",
"hopscotch": {
"model_id": "openai/gpt-4o-mini",
"display_name": "GPT-4o mini",
"author": "openai",
"context_window_tokens": 128000,
"max_output_tokens": 16384,
"input_rate_thousandths": 150,
"output_rate_thousandths": 600,
"currency_code": "USD",
"endpoint_families": [
"chat_completions"
],
"provider_display_names": [
"OpenAI"
],
"capabilities": {
"audio": "no",
"json_mode": "yes",
"streaming": "yes",
"tools": "yes",
"vision": "yes"
}
}
}
]
}{
"error": {
"message": "Incorrect API key format. A Hopscotch key looks like ub_live_ followed by 43 characters. Check you have not pasted a key from another provider.",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key",
"request_id": "REQUEST_ID"
}
}{
"error": {
"message": "POST is not supported for /v1/models in this release.",
"type": "invalid_request_error",
"param": null,
"code": "method_not_allowed",
"request_id": "REQUEST_ID"
}
}{
"error": {
"message": "Rate limit reached for this key. Try again in 12 seconds. Request id REQUEST_ID.",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded",
"request_id": "REQUEST_ID"
}
}{
"error": {
"message": "The server had an error while processing your request. Sorry about that! Quote the request id if you contact support.",
"type": "api_error",
"param": null,
"code": null,
"request_id": "REQUEST_ID"
}
}{
"error": {
"message": "No provider is configured, so there is nothing to serve this request.",
"type": "api_error",
"param": null,
"code": "no_provider_configured",
"request_id": "REQUEST_ID"
}
}Authorizations
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.