Skip to main content

Path Parameters

model
string
required
The ID of the model to retrieve (e.g., gpt-5.4, claude-sonnet-4-6).

Model Deletion

DELETE /v1/models/{model} is not supported. TokenLab models are a shared public catalog, not user-owned fine-tuned model resources.

Response

id
string
Model identifier. It also includes lifecycle, commercial, and badges, which describe deprecation/retirement state, user charge policy, and display badges.
object
string
Always model.
created
integer
Creation timestamp.
owned_by
string
Model provider.
tokenlab
object
TokenLab-specific public metadata. The detail route can include category, pricing_unit, capability_flags, supported_operations, pricing_provenance, request_format_summary, the full request_format_details, and scene-level agent_preferences for non-chat recommendation snapshots.
curl "https://api.tokenlab.sh/v1/models/gpt-5.4" \
  -H "Authorization: Bearer sk-your-api-key"
from openai import OpenAI

client = OpenAI(
    api_key="sk-your-api-key",
    base_url="https://api.tokenlab.sh/v1"
)

model = client.models.retrieve("gpt-5.4")
print(f"Model: {model.id}, Provider: {model.owned_by}")
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'sk-your-api-key',
  baseURL: 'https://api.tokenlab.sh/v1'
});

const model = await client.models.retrieve('gpt-5.4');
console.log(`Model: ${model.id}, Provider: ${model.owned_by}`);
package main

import (
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.tokenlab.sh/v1/models/gpt-5.4", nil)
    req.Header.Set("Authorization", "Bearer sk-your-api-key")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    var model map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&model)
    fmt.Printf("Model: %s, Provider: %s\n", model["id"], model["owned_by"])
}
<?php
$ch = curl_init('https://api.tokenlab.sh/v1/models/gpt-5.4');

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer sk-your-api-key'
    ]
]);

$response = curl_exec($ch);
curl_close($ch);

$model = json_decode($response, true);
echo "Model: {$model['id']}, Provider: {$model['owned_by']}\n";
{
  "id": "gpt-5.4",
  "object": "model",
  "created": 1706000000,
  "owned_by": "openai"
}

Error Handling

If the model doesn’t exist, you’ll receive a 404 error:
{
  "error": {
    "message": "Model 'invalid-model' not found",
    "type": "invalid_request_error",
    "code": "model_not_found"
  }
}

Non-Chat Recommendation Metadata

For non-chat models, the detail route also returns tokenlab.agent_preferences.<scene>. Use it to inspect:
  • preferred_rank
  • success_rate_24h
  • sample_count_24h
  • status
  • updated_at
The public response summarizes recommendation provenance with basis.source and does not expose routing identifiers.

Public Detail Metadata

Compared with GET /v1/models, the detail route can additionally return:
  • tokenlab.capability_flags
  • tokenlab.supported_operations
  • tokenlab.pricing_provenance
  • tokenlab.request_format_summary
  • tokenlab.request_format_details