opendunes
Catalogue
Copy page ▾

Allowed models

GET /v1/models/user lists the models on sale that your settings allow the key to call, with their prices in DADAThe Algerian dinar, the one currency the docs show.More on Balance and charges →.

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 settings read are the guardrails assigned to that key: a model a guardrail leaves out is not listed, and where several are assigned, their model lists intersect. On a key with no guardrail, it lists what All models lists. The models guide shows how to pick a model and read its ID.

Yacine gives Souk Bot's key a guardrail that allows two models. This route, on that key, lists those two, and no other.

FieldNeededYou send
output_modalitiesnotext 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 listed when it answers in any of them.

import json
import os
import urllib.request

API_KEY = os.environ["OPENDUNES_API_KEY"]
ADDRESS = "https://opendunes.com/v1/models/user?output_modalities=all"

request = urllib.request.Request(
    ADDRESS,
    headers={"Authorization": "Bearer " + API_KEY},
)
with urllib.request.urlopen(request) as response:
    models = json.load(response)["data"]

for model in models:
    print(model["id"])

Response

200 OK.

FieldHolds
dataevery model the key may call, newest first; an empty list when its guardrails allow none on sale
idin each: its ID, lab/model: the name a request sends
pricingin each: its prices in DA, one per meter it has, each a string per unit of that meter, with discount beside them

Each model carries every field All models describes, in the same shape.

What it cost

Free. Reading the catalogue is never charged.

Errors

error.code carries the status, and error.message says why.

StatusWhen
401the key is missing, wrong, disabled or expired
403the key answers only from the addresses set on it, and this request came from another

Last modified on