TypeScript SDK
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const model = await client.models.retrieve("ninja/auto");
console.log(model);import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
model = client.models.retrieve("ninja/auto")
print(model)curl --request GET \
--url https://www.ninjachat.ai/api/v1/models/{id}{
"object": "model",
"created": 123,
"owned_by": "<string>",
"id": "<string>",
"name": "<string>",
"modality": "text",
"status": "preview",
"servable": true,
"capabilities": [
"<string>"
],
"pricing": {
"unit": "token",
"typicalRequestUsd": 1,
"meteredPromptPerToken": 1,
"meteredCachedPromptPerToken": 1,
"meteredCacheWritePromptPerToken": 1,
"meteredCompletionPerToken": 1,
"perRequestUsd": 1,
"perUnitUsd": 1,
"listPerUnitUsd": 1,
"promotion": {
"label": "<string>",
"discountPercent": 99,
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z"
}
},
"providers": [
{
"provider": "<string>",
"providerDisplayName": "<string>",
"upstreamModelId": "<string>",
"role": "primary",
"available": true,
"unsupportedCapabilities": [
"tools"
],
"trainsOnData": true,
"zeroRetentionAvailable": true,
"contextWindow": 123,
"maxOutputTokens": 123,
"performance": {
"samples": 1,
"successRate": 123,
"p50Ms": 123,
"p95Ms": 123,
"medianTtftMs": 123,
"thin": true
}
}
],
"supportedParameters": [
"<string>"
],
"brand": "<string>",
"description": "<string>",
"contextWindow": 123,
"maxOutputTokens": 123,
"virtual": true,
"pricingNote": "<string>",
"overlay": {
"isOverlay": true,
"dispatch": "live",
"overrideStatus": "<string>"
},
"history": [
{}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Models & pricing
Get a live model
GET
/
models
/
{id}
TypeScript SDK
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const model = await client.models.retrieve("ninja/auto");
console.log(model);import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
model = client.models.retrieve("ninja/auto")
print(model)curl --request GET \
--url https://www.ninjachat.ai/api/v1/models/{id}{
"object": "model",
"created": 123,
"owned_by": "<string>",
"id": "<string>",
"name": "<string>",
"modality": "text",
"status": "preview",
"servable": true,
"capabilities": [
"<string>"
],
"pricing": {
"unit": "token",
"typicalRequestUsd": 1,
"meteredPromptPerToken": 1,
"meteredCachedPromptPerToken": 1,
"meteredCacheWritePromptPerToken": 1,
"meteredCompletionPerToken": 1,
"perRequestUsd": 1,
"perUnitUsd": 1,
"listPerUnitUsd": 1,
"promotion": {
"label": "<string>",
"discountPercent": 99,
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z"
}
},
"providers": [
{
"provider": "<string>",
"providerDisplayName": "<string>",
"upstreamModelId": "<string>",
"role": "primary",
"available": true,
"unsupportedCapabilities": [
"tools"
],
"trainsOnData": true,
"zeroRetentionAvailable": true,
"contextWindow": 123,
"maxOutputTokens": 123,
"performance": {
"samples": 1,
"successRate": 123,
"p50Ms": 123,
"p95Ms": 123,
"medianTtftMs": 123,
"thin": true
}
}
],
"supportedParameters": [
"<string>"
],
"brand": "<string>",
"description": "<string>",
"contextWindow": 123,
"maxOutputTokens": 123,
"virtual": true,
"pricingNote": "<string>",
"overlay": {
"isOverlay": true,
"dispatch": "live",
"overrideStatus": "<string>"
},
"history": [
{}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Path Parameters
Response
Runtime model detail.
Available options:
model Required string length:
1 - 160Available options:
text, image, image_edit, video, audio, embedding, rerank, search Available options:
preview, ga, deprecated, retired Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes