curl --request GET \
--url https://api.flex.ai/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.flex.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.flex.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.flex.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.flex.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.flex.ai/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flex.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": "<string>",
"object": "model",
"created": 123,
"owned_by": "flexai",
"context_length": 123,
"max_output_length": 123,
"pricing": {
"currency": "USD",
"input_per_mtok": 123,
"output_per_mtok": 123,
"cached_input_per_mtok": 123,
"prompt": "<string>",
"completion": "<string>",
"input_cache_read": "<string>",
"request": "<string>",
"image": "<string>",
"web_search": "<string>",
"internal_reasoning": "<string>"
},
"media_pricing": [
{
"currency": "USD",
"billing_unit": "image",
"unit_price_usd": 123,
"resolution_tier": "<string>",
"quality_tier": "<string>",
"preset": "<string>"
}
],
"hugging_face_id": "<string>",
"aliases": [
"<string>"
],
"name": "<string>",
"category": "text",
"input_modalities": [
"text"
],
"output_modalities": [
"text"
],
"quantization": "int4",
"is_free": true,
"is_ready": true,
"supported_features": [
"tools"
],
"supported_parameters": [
"<string>"
],
"supported_sampling_parameters": [
"<string>"
],
"legal_caveat": "eu_caution",
"description": "<string>",
"provider": "<string>",
"supports": [
"<string>"
],
"slug": "<string>",
"provider_logo": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"doc_url": "<string>"
}
}List available models
Returns every model currently being served to your account — chat,
code, reasoning, vision, embedding, image, audio and video — in
OpenAI’s Model shape. Early-access models appear only for
organizations granted access to them. This is the catalog to build against: each entry says
which endpoint to call (category), how much prompt it accepts
(context_length), the longest completion it will produce
(max_output_length), which request parameters it honors
(supported_parameters) and what it costs (pricing for per-token
models, media_pricing for per-unit models).
Each entry is enriched with OpenRouter-spec metadata so
third-party catalog ingesters can consume /v1/models directly.
The OpenAI-compatible top-level keys (id, object, created,
owned_by) stay byte-identical for back-compat with the OpenAI Python
SDK. owned_by is always "flexai" — clients branching on the legacy
"openai" placeholder must update. The OpenAI SDK’s models.list()
surfaces only those four keys as typed attributes; read the raw JSON
(or model.model_extra in the Python SDK) for the rest.
Prices. Per-token models carry pricing: input_per_mtok /
output_per_mtok are USD per million tokens as numbers, and prompt /
completion are the same rates in USD per single token as decimal
strings (OpenRouter’s convention), so "0.0000002" is $0.20 per
million. Per-unit models carry media_pricing, in USD per
billing_unit. Both state currency.
null means not published, never zero or unlimited.
context_length, max_output_length, pricing and media_pricing
are present on every entry. A null limit means we have not published
one — the model still has limits — and a null price means the rate is
not published yet, not that the model is free (is_free is always
false). pricing is always null on per-unit models and
media_pricing on per-token models. Other optional fields are omitted
when we have no value for them.
The list is live: a model that is scaled down or restarting drops out
until it is serving again, so treat a missing id as “not available
right now” rather than “retired”. If the service has no readiness
signal at all, it returns the full catalog instead and sets the
X-FlexAI-Models-Degraded: no-readiness-signal response header —
the list is still fine for discovery, but not a liveness verdict.
Responses are Cache-Control: private, max-age=30.
curl --request GET \
--url https://api.flex.ai/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.flex.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.flex.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.flex.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.flex.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.flex.ai/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flex.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": "<string>",
"object": "model",
"created": 123,
"owned_by": "flexai",
"context_length": 123,
"max_output_length": 123,
"pricing": {
"currency": "USD",
"input_per_mtok": 123,
"output_per_mtok": 123,
"cached_input_per_mtok": 123,
"prompt": "<string>",
"completion": "<string>",
"input_cache_read": "<string>",
"request": "<string>",
"image": "<string>",
"web_search": "<string>",
"internal_reasoning": "<string>"
},
"media_pricing": [
{
"currency": "USD",
"billing_unit": "image",
"unit_price_usd": 123,
"resolution_tier": "<string>",
"quality_tier": "<string>",
"preset": "<string>"
}
],
"hugging_face_id": "<string>",
"aliases": [
"<string>"
],
"name": "<string>",
"category": "text",
"input_modalities": [
"text"
],
"output_modalities": [
"text"
],
"quantization": "int4",
"is_free": true,
"is_ready": true,
"supported_features": [
"tools"
],
"supported_parameters": [
"<string>"
],
"supported_sampling_parameters": [
"<string>"
],
"legal_caveat": "eu_caution",
"description": "<string>",
"provider": "<string>",
"supports": [
"<string>"
],
"slug": "<string>",
"provider_logo": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"doc_url": "<string>"
}
}Authorizations
Virtual API key. Create one from the
FlexAI dashboard. Pass as
Authorization: Bearer sk-xxxx.
Was this page helpful?