Catalogue
Model count
GET /v1/models/count answers how many models are on sale, as one number.
Request
Send it with an API keyAPI keyThe key you create and send with every request that calls a model.More on API keys →. The one field goes in the address, after ?. The
models guide shows how a model is named and picked.
| Field | Needed | You send |
|---|---|---|
output_modalities | no | text when left out · a list such as image,audio · all |
output_modalities takes text, image, embeddings, audio, video, rerank, decisions,
speech and transcription. A model is counted when it answers in any of them, so the count
matches the length of what All models lists for the same value.
import json
import os
import urllib.request
API_KEY = os.environ["OPENDUNES_API_KEY"]
ADDRESS = "https://opendunes.com/v1/models/count?output_modalities=all"
request = urllib.request.Request(
ADDRESS,
headers={"Authorization": "Bearer " + API_KEY},
)
with urllib.request.urlopen(request) as response:
count = json.load(response)["data"]["count"]
print(count)Response
200 OK.
| Field | Holds |
|---|---|
data | the count |
count | in data: how many models are on sale in the output types you asked for. A type no model answers in counts 0 |
What it cost
Free. Reading the catalogue is never charged.
Errors
error.code carries the status, and error.message says why.
| Status | When |
|---|---|
| 401 | the key is missing, wrong, disabled or expired |
| 403 | the key answers only from the addresses set on it, and this request came from another |
Last modified on