Ana içeriğe atla

Yol Parametreleri

model
string
gerekli
Getirilecek modelin ID’si (örneğin gpt-5.4, claude-sonnet-4-6).

Yanıt

id
string
Model tanımlayıcısı. Ayrıca kullanım dışı/retired durumu, kullanıcı ücret politikası ve rozetler için lifecycle, commercial ve badges içerir.
object
string
Her zaman model.
created
integer
Oluşturulma zaman damgası.
owned_by
string
Model sağlayıcısı.
tokenlab
object
TokenLab’ya özgü herkese açık metadata. Detay route’u category, pricing_unit, capability_flags, supported_operations, pricing_provenance, request_format_summary, tam request_format_details ve chat dışı öneri snapshot’ları için sahne düzeyinde agent_preferences içerebilir.
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"
}

Hata İşleme

Model yoksa 404 hatası alırsınız:
{
  "error": {
    "message": "Model 'invalid-model' not found",
    "type": "invalid_request_error",
    "code": "model_not_found"
  }
}

Chat Dışı Öneri Metadata’sı

Chat dışı modeller için detay route’u ayrıca tokenlab.agent_preferences.<scene> döndürür. Bunu şunları incelemek için kullanın:
  • preferred_rank
  • success_rate_24h
  • sample_count_24h
  • status
  • updated_at
Public yanıt, öneri kaynağını basis.source ile özetler ve routing identifier göstermez.

Herkese Açık Detay Metadata’sı

GET /v1/models ile karşılaştırıldığında, detay route’u ayrıca şunları döndürebilir:
  • tokenlab.capability_flags
  • tokenlab.supported_operations
  • tokenlab.pricing_provenance
  • tokenlab.request_format_summary
  • tokenlab.request_format_details

Model Silme

DELETE /v1/models/{model} desteklenmez. TokenLab modelleri paylaşılan herkese açık bir katalogdur, kullanıcıya ait fine-tuned model kaynakları değildir.