JavaScript
import Cadenya from '@cadenya/cadenya';
const client = new Cadenya({
apiKey: process.env['CADENYA_API_KEY'], // This is the default and can be omitted
});
const model = await client.models.enable('model_01HXKD2E5NQM3T9AYWCFKJ4GED', {
workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
});
console.log(model.metadata);import os
from cadenya import Cadenya
client = Cadenya(
api_key=os.environ.get("CADENYA_API_KEY"), # This is the default and can be omitted
)
model = client.models.enable(
id="model_01HXKD2E5NQM3T9AYWCFKJ4GED",
workspace_id="workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
)
print(model.metadata)package main
import (
"context"
"fmt"
"go.cadenya.com/cadenya-go"
"go.cadenya.com/cadenya-go/option"
)
func main() {
client := cadenya.NewClient(
option.WithAPIKey("My API Key"),
)
model, err := client.Models.Enable(
context.TODO(),
"model_01HXKD2E5NQM3T9AYWCFKJ4GED",
cadenya.ModelEnableParams{
WorkspaceID: cadenya.String("workspace_01HXKD2E5NQM3T9AYWCF133E3Q"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", model.Metadata)
}
require "cadenya"
cadenya = Cadenya::Client.new(api_key: "My API Key")
model = cadenya.models.enable(
"model_01HXKD2E5NQM3T9AYWCFKJ4GED",
workspace_id: "workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
)
puts(model)cadenya models enable \
--api-key 'My API Key' \
--workspace-id workspace_01HXKD2E5NQM3T9AYWCF133E3Q \
--id model_01HXKD2E5NQM3T9AYWCFKJ4GEDcurl --request POST \
--url https://api.cadenya.com/v1/workspaces/{workspaceId}/models/{id}:enable \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cadenya.com/v1/workspaces/{workspaceId}/models/{id}:enable",
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([
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.cadenya.com/v1/workspaces/{workspaceId}/models/{id}:enable")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();{
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"workspaceId": "workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"createdAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"labels": {},
"updatedAt": "2023-11-07T05:31:56Z"
},
"spec": {
"provider": "<string>",
"family": "<string>",
"maxInputTokens": 123,
"maxOutputTokens": 123,
"inputPricePerMillionTokens": "<string>",
"outputPricePerMillionTokens": "<string>"
},
"info": {
"aiProviderKey": {
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"workspaceId": "workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"createdAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"labels": {},
"updatedAt": "2023-11-07T05:31:56Z"
},
"spec": {
"credentials": {
"type": "apiKey",
"apiKey": {
"apiKey": "<string>"
}
},
"config": {
"type": "openrouter",
"openrouter": {
"region": "<string>"
}
}
},
"info": {
"enabledModelCount": 123,
"disabledModelCount": 123,
"isPromotional": true
}
},
"agentVariationCount": 123,
"lastUsedAt": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Models
Enable a model
Transitions a model to STATE_ENABLED, making it available for agent variations in the workspace
POST
/
v1
/
workspaces
/
{workspaceId}
/
models
/
{id}
:enable
JavaScript
import Cadenya from '@cadenya/cadenya';
const client = new Cadenya({
apiKey: process.env['CADENYA_API_KEY'], // This is the default and can be omitted
});
const model = await client.models.enable('model_01HXKD2E5NQM3T9AYWCFKJ4GED', {
workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
});
console.log(model.metadata);import os
from cadenya import Cadenya
client = Cadenya(
api_key=os.environ.get("CADENYA_API_KEY"), # This is the default and can be omitted
)
model = client.models.enable(
id="model_01HXKD2E5NQM3T9AYWCFKJ4GED",
workspace_id="workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
)
print(model.metadata)package main
import (
"context"
"fmt"
"go.cadenya.com/cadenya-go"
"go.cadenya.com/cadenya-go/option"
)
func main() {
client := cadenya.NewClient(
option.WithAPIKey("My API Key"),
)
model, err := client.Models.Enable(
context.TODO(),
"model_01HXKD2E5NQM3T9AYWCFKJ4GED",
cadenya.ModelEnableParams{
WorkspaceID: cadenya.String("workspace_01HXKD2E5NQM3T9AYWCF133E3Q"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", model.Metadata)
}
require "cadenya"
cadenya = Cadenya::Client.new(api_key: "My API Key")
model = cadenya.models.enable(
"model_01HXKD2E5NQM3T9AYWCFKJ4GED",
workspace_id: "workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
)
puts(model)cadenya models enable \
--api-key 'My API Key' \
--workspace-id workspace_01HXKD2E5NQM3T9AYWCF133E3Q \
--id model_01HXKD2E5NQM3T9AYWCFKJ4GEDcurl --request POST \
--url https://api.cadenya.com/v1/workspaces/{workspaceId}/models/{id}:enable \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cadenya.com/v1/workspaces/{workspaceId}/models/{id}:enable",
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([
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.cadenya.com/v1/workspaces/{workspaceId}/models/{id}:enable")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();{
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"workspaceId": "workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"createdAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"labels": {},
"updatedAt": "2023-11-07T05:31:56Z"
},
"spec": {
"provider": "<string>",
"family": "<string>",
"maxInputTokens": 123,
"maxOutputTokens": 123,
"inputPricePerMillionTokens": "<string>",
"outputPricePerMillionTokens": "<string>"
},
"info": {
"aiProviderKey": {
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"workspaceId": "workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"createdAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"labels": {},
"updatedAt": "2023-11-07T05:31:56Z"
},
"spec": {
"credentials": {
"type": "apiKey",
"apiKey": {
"apiKey": "<string>"
}
},
"config": {
"type": "openrouter",
"openrouter": {
"region": "<string>"
}
}
},
"info": {
"enabledModelCount": 123,
"disabledModelCount": 123,
"isPromotional": true
}
},
"agentVariationCount": 123,
"lastUsedAt": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Workspace ID.
Example:
"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
Model ID
Example:
"model_01HXKD2E5NQM3T9AYWCFKJ4GED"
Body
application/json
Enable model request
Response
OK
Resource metadata
Show child attributes
Show child attributes
Model specification
Show child attributes
Show child attributes
Whether the model is usable in this workspace. Output only. Use the :enable and :disable actions to transition.
Available options:
STATE_UNSPECIFIED, STATE_ENABLED, STATE_DISABLED Server-populated info (e.g. the AI provider this model routes through). Populated on reads when requested; see ListModelsRequest.include_info.
Show child attributes
Show child attributes
⌘I