GlexirDocs
Dashboard

API

Models

The Models endpoint lists the models your Glexir key can call. It uses OpenAI's model IDs and returns OpenAI's model objects, with owned_by set to "glexir".

The list only contains models Glexir sells: text models, embedding models and speech-to-text models that have a price in the current price book. Image, video, realtime, text-to-speech and moderation models never appear, and neither do fine-tuned (ft:) models.

List models

import Glexir from "@glexir/sdk";

const glexir = new Glexir({ apiKey: process.env.GLEXIR_API_KEY });

for await (const model of glexir.models.list()) {
  console.log(model.id, model.shutdown_date ?? "");
}

Response:

JSON
{
  "object": "list",
  "data": [
    { "id": "gpt-5.4", "object": "model", "created": 1767225600, "owned_by": "glexir" },
    { "id": "text-embedding-3-small", "object": "model", "created": 1705948997, "owned_by": "glexir" },
    { "id": "gpt-transcribe", "object": "model", "created": 1767225600, "owned_by": "glexir" }
  ]
}

The list is a single page. It has no has_more cursor, so for await stops after the first page.

Retrieve a model

import Glexir from "@glexir/sdk";

const glexir = new Glexir();

const model = await glexir.models.retrieve("gpt-5.4");
console.log(model.id, model.owned_by);

If Glexir does not sell the model, the call fails with 404 and code model_not_found. In the SDK that is a NotFoundError.

Methods

TypeScript
import type { APIPromise, Model, PagePromise, RequestOptions } from "@glexir/sdk";

// The methods on glexir.models
interface Models {
  list(options?: RequestOptions): PagePromise<Model>;
  retrieve(model: string, options?: RequestOptions): APIPromise<Model>;
}

glexir.models.list()

GET /models. Await it for a CursorPage<Model> (read page.data), or iterate it with for await to get each Model. options are the per-request options described in Client configuration.

glexir.models.retrieve()

GET /models/{model}. The SDK URL-encodes the ID.

Model object

Model
idstringrequired
The OpenAI model ID, for example gpt-5.4.
object"model"required
Always model.
creatednumberrequired
Unix timestamp in seconds, as reported by OpenAI.
owned_bystringrequired
Always glexir on Glexir.
shutdown_datestring | nulloptional
Set when the model is scheduled to shut down.
_request_idstring | nulloptional
SDK only. The x-request-id response header. Not enumerable, so it does not show up in JSON.stringify.

Which models you can use

A model is listed and callable when all of these are true:

  • It is a text, embedding or speech-to-text model. Glexir classifies models by ID.
  • It has a price in the current price book. See Pricing.
  • It is not a fine-tuned (ft:) model.

Some text models, such as the -pro models, work only with Responses. Calling them through Chat Completions returns 400 with code model_not_found.

Errors

StatusCodeWhen
401invalid_api_keyThe key is missing or invalid.
404model_not_foundretrieve was called with a model Glexir does not sell.
429rate_limit_exceededYou passed your requests-per-minute limit.

See HTTP error codes for the full list.