Pular para o conteúdo principal
POST
/
api
/
v1
/
llm
/
models
/
registry
/
cluster
CSharp (SDK)
using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;

var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

AddRegistryModelRequest req = new AddRegistryModelRequest() {
    Id = "meetkai:my-custom-chat-v1",
    Provider = "openai-compatible",
    ModelId = "my-custom-chat-v1",
    DisplayName = "My Custom Chat v1",
    BaseUrl = "https://models.example.com/v1",
    ApiFormat = AutoEndpoint.Responses,
    ApiProviderType = AddRegistryModelRequestApiProviderType.Groq,
    Created = 1704067200,
    Auth = AddRegistryModelRequestAuthUnion.CreateApiKey(
        new AddRegistryModelRequestAuth1() {
            Value = "sk-your-provider-api-key",
        }
    ),
    Capabilities = new AddRegistryModelRequestCapabilities() {
        Modalities = new AddRegistryModelRequestModalities() {
            Input = new List<AddRegistryModelRequestInput>() {
                AddRegistryModelRequestInput.Text,
            },
            Output = new List<AddRegistryModelRequestOutput>() {
                AddRegistryModelRequestOutput.Text,
            },
        },
        Reasoning = true,
        SupportsTemperature = true,
        SupportsTopP = true,
    },
    ContextWindow = 131072,
    Rpm = 120,
    DefaultParams = new AddRegistryModelRequestDefaultParams() {
        Temperature = 0.2D,
        TopP = 0.95D,
    },
    Hidden = false,
    HealthCheck = AddRegistryModelRequestHealthCheckUnion.CreatePreflight(
        new AddRegistryModelRequestHealthCheck2() {
            Path = "/home",
        }
    ),
};

var res = await sdk.Llm.Models.AddClusterRegistryModelAsync(req);

// handle response
from meetkai_mka1 import SDK


with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

res = sdk.llm.models.add_cluster_registry_model(id="meetkai:my-custom-chat-v1", provider="openai-compatible", model_id="my-custom-chat-v1", api_format="responses", api_provider_type="groq", created=1704067200, auth={
"type": "api-key",
"value": "sk-your-provider-api-key",
}, capabilities={
"modalities": {
"input": [
"text",
],
"output": [
"text",
],
},
"reasoning": True,
"supports_temperature": True,
"supports_top_p": True,
}, display_name="My Custom Chat v1", base_url="https://models.example.com/v1", context_window=131072, rpm=120, default_params={
"temperature": 0.2,
"top_p": 0.95,
}, hidden=False, health_check={
"mode": "preflight",
"path": "/home",
})

# Handle response
print(res)
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
const result = await sdk.llm.models.addClusterRegistryModel({
id: "meetkai:my-custom-chat-v1",
provider: "openai-compatible",
modelId: "my-custom-chat-v1",
displayName: "My Custom Chat v1",
baseUrl: "https://models.example.com/v1",
apiFormat: "responses",
apiProviderType: "groq",
created: 1704067200,
auth: {
type: "api-key",
value: "sk-your-provider-api-key",
},
capabilities: {
modalities: {
input: [
"text",
],
output: [
"text",
],
},
reasoning: true,
supportsTemperature: true,
supportsTopP: true,
},
contextWindow: 131072,
rpm: 120,
defaultParams: {
temperature: 0.2,
topP: 0.95,
},
hidden: false,
healthCheck: {
mode: "preflight",
path: "/home",
},
});

console.log(result);
}

run();
curl --request POST \
--url https://apigw.mka1.com/api/v1/llm/models/registry/cluster \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "meetkai:my-custom-chat-v1",
"provider": "openai-compatible",
"modelId": "my-custom-chat-v1",
"displayName": "My Custom Chat v1",
"baseUrl": "https://models.example.com/v1",
"apiFormat": "responses",
"created": 1704067200,
"auth": {
"type": "api-key",
"value": "sk-your-provider-api-key"
},
"capabilities": {
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"reasoning": true,
"supportsTemperature": true,
"supportsTopP": true
},
"contextWindow": 131072,
"rpm": 120,
"defaultParams": {
"temperature": 0.2,
"topP": 0.95
},
"hidden": false,
"healthCheck": {
"url": "https://models.example.com/health",
"method": "GET"
}
}
'
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'meetkai:my-custom-chat-v1',
provider: 'openai-compatible',
modelId: 'my-custom-chat-v1',
displayName: 'My Custom Chat v1',
baseUrl: 'https://models.example.com/v1',
apiFormat: 'responses',
created: 1704067200,
auth: {type: 'api-key', value: 'sk-your-provider-api-key'},
capabilities: {
modalities: {input: ['text'], output: ['text']},
reasoning: true,
supportsTemperature: true,
supportsTopP: true
},
contextWindow: 131072,
rpm: 120,
defaultParams: {temperature: 0.2, topP: 0.95},
hidden: false,
healthCheck: {url: 'https://models.example.com/health', method: 'GET'}
})
};

fetch('https://apigw.mka1.com/api/v1/llm/models/registry/cluster', 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://apigw.mka1.com/api/v1/llm/models/registry/cluster",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'meetkai:my-custom-chat-v1',
'provider' => 'openai-compatible',
'modelId' => 'my-custom-chat-v1',
'displayName' => 'My Custom Chat v1',
'baseUrl' => 'https://models.example.com/v1',
'apiFormat' => 'responses',
'created' => 1704067200,
'auth' => [
'type' => 'api-key',
'value' => 'sk-your-provider-api-key'
],
'capabilities' => [
'modalities' => [
'input' => [
'text'
],
'output' => [
'text'
]
],
'reasoning' => true,
'supportsTemperature' => true,
'supportsTopP' => true
],
'contextWindow' => 131072,
'rpm' => 120,
'defaultParams' => [
'temperature' => 0.2,
'topP' => 0.95
],
'hidden' => false,
'healthCheck' => [
'url' => 'https://models.example.com/health',
'method' => 'GET'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://apigw.mka1.com/api/v1/llm/models/registry/cluster"

payload := strings.NewReader("{\n \"id\": \"meetkai:my-custom-chat-v1\",\n \"provider\": \"openai-compatible\",\n \"modelId\": \"my-custom-chat-v1\",\n \"displayName\": \"My Custom Chat v1\",\n \"baseUrl\": \"https://models.example.com/v1\",\n \"apiFormat\": \"responses\",\n \"created\": 1704067200,\n \"auth\": {\n \"type\": \"api-key\",\n \"value\": \"sk-your-provider-api-key\"\n },\n \"capabilities\": {\n \"modalities\": {\n \"input\": [\n \"text\"\n ],\n \"output\": [\n \"text\"\n ]\n },\n \"reasoning\": true,\n \"supportsTemperature\": true,\n \"supportsTopP\": true\n },\n \"contextWindow\": 131072,\n \"rpm\": 120,\n \"defaultParams\": {\n \"temperature\": 0.2,\n \"topP\": 0.95\n },\n \"hidden\": false,\n \"healthCheck\": {\n \"url\": \"https://models.example.com/health\",\n \"method\": \"GET\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://apigw.mka1.com/api/v1/llm/models/registry/cluster")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"meetkai:my-custom-chat-v1\",\n \"provider\": \"openai-compatible\",\n \"modelId\": \"my-custom-chat-v1\",\n \"displayName\": \"My Custom Chat v1\",\n \"baseUrl\": \"https://models.example.com/v1\",\n \"apiFormat\": \"responses\",\n \"created\": 1704067200,\n \"auth\": {\n \"type\": \"api-key\",\n \"value\": \"sk-your-provider-api-key\"\n },\n \"capabilities\": {\n \"modalities\": {\n \"input\": [\n \"text\"\n ],\n \"output\": [\n \"text\"\n ]\n },\n \"reasoning\": true,\n \"supportsTemperature\": true,\n \"supportsTopP\": true\n },\n \"contextWindow\": 131072,\n \"rpm\": 120,\n \"defaultParams\": {\n \"temperature\": 0.2,\n \"topP\": 0.95\n },\n \"hidden\": false,\n \"healthCheck\": {\n \"url\": \"https://models.example.com/health\",\n \"method\": \"GET\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://apigw.mka1.com/api/v1/llm/models/registry/cluster")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"meetkai:my-custom-chat-v1\",\n \"provider\": \"openai-compatible\",\n \"modelId\": \"my-custom-chat-v1\",\n \"displayName\": \"My Custom Chat v1\",\n \"baseUrl\": \"https://models.example.com/v1\",\n \"apiFormat\": \"responses\",\n \"created\": 1704067200,\n \"auth\": {\n \"type\": \"api-key\",\n \"value\": \"sk-your-provider-api-key\"\n },\n \"capabilities\": {\n \"modalities\": {\n \"input\": [\n \"text\"\n ],\n \"output\": [\n \"text\"\n ]\n },\n \"reasoning\": true,\n \"supportsTemperature\": true,\n \"supportsTopP\": true\n },\n \"contextWindow\": 131072,\n \"rpm\": 120,\n \"defaultParams\": {\n \"temperature\": 0.2,\n \"topP\": 0.95\n },\n \"hidden\": false,\n \"healthCheck\": {\n \"url\": \"https://models.example.com/health\",\n \"method\": \"GET\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "meetkai:my-custom-chat-v1",
  "provider": "openai-compatible",
  "model_id": "my-custom-chat-v1",
  "source": "database",
  "immutable": false,
  "definition": {
    "id": "meetkai:my-custom-chat-v1",
    "provider": "openai-compatible",
    "modelId": "my-custom-chat-v1",
    "displayName": "My Custom Chat v1",
    "baseUrl": "https://models.example.com/v1",
    "apiFormat": "responses",
    "created": 1704067200,
    "auth": {
      "type": "api-key",
      "value": "****"
    },
    "capabilities": {
      "modalities": {
        "input": [
          "text"
        ],
        "output": [
          "text"
        ]
      },
      "reasoning": true,
      "supportsTemperature": true,
      "supportsTopP": true
    },
    "contextWindow": 131072,
    "rpm": 120,
    "defaultParams": {
      "temperature": 0.2,
      "topP": 0.95
    },
    "hidden": false,
    "healthCheck": {
      "mode": "preflight",
      "path": "/models"
    },
    "source": "database",
    "immutable": false
  },
  "health": {
    "is_available": true,
    "last_health_check": 1704067200000,
    "error": null
  },
  "created_at": 1704067200000,
  "updated_at": 1704153600000
}

Autorizações

Authorization
string
header
obrigatório

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Corpo

application/json
id
string
obrigatório
provider
string
obrigatório
modelId
string
obrigatório
apiFormat
enum<string>
obrigatório
Opções disponíveis:
responses,
completions,
embeddings,
images,
transcriptions,
tts
apiProviderType
enum<string>
obrigatório
Opções disponíveis:
groq,
azure,
meetkai,
meetkaiGateway,
fal,
openai
created
integer
obrigatório
Intervalo obrigatório: 0 <= x <= 9007199254740991
auth
object
obrigatório
capabilities
object
obrigatório
displayName
string
baseUrl
string<uri>
contextWindow
integer
Intervalo obrigatório: -9007199254740991 < x <= 9007199254740991
rpm
integer
Intervalo obrigatório: -9007199254740991 < x <= 9007199254740991
rateLimits
object[]
defaultParams
object
rerouteRules
object[]
hidden
boolean
embeddingLimits
object
healthCheck
object

Resposta

200 - application/json

OK

id
string
obrigatório
provider
string
obrigatório
model_id
string
obrigatório
source
string
obrigatório
immutable
boolean
obrigatório
definition
object
obrigatório
health
object
obrigatório
created_at
number | null
obrigatório
updated_at
number | null
obrigatório