JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const steerResult = await client.threads.steer('agent_abc123', 'thread_abc123', {
message: 'message',
});
console.log(steerResult.status);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
steer_result = client.threads.steer(
agent_id="agent_abc123",
thread_id="thread_abc123",
message="message",
)
print(steer_result.status)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
steerResult, err := client.Threads.Steer(
context.TODO(),
"agent_abc123",
"thread_abc123",
cercago.ThreadSteerParams{
Message: cercago.F("message"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", steerResult.Status)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
steer_result = cerca.threads.steer("agent_abc123", "thread_abc123", message: "message")
puts(steer_result)cerca threads steer \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--thread-id thread_abc123 \
--message messagecurl --request POST \
--url https://api.cerca.dev/agents/{agentId}/threads/{threadId}/steer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/threads/{threadId}/steer",
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([
'message' => '<string>'
]),
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.cerca.dev/agents/{agentId}/threads/{threadId}/steer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();{
"turnId": "<string>"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Threads
Steer thread
Steer a thread with another user message. Steering a closed thread returns a conflict; steering a running or awaiting thread queues the message.
POST
/
agents
/
{agentId}
/
threads
/
{threadId}
/
steer
JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const steerResult = await client.threads.steer('agent_abc123', 'thread_abc123', {
message: 'message',
});
console.log(steerResult.status);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
steer_result = client.threads.steer(
agent_id="agent_abc123",
thread_id="thread_abc123",
message="message",
)
print(steer_result.status)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
steerResult, err := client.Threads.Steer(
context.TODO(),
"agent_abc123",
"thread_abc123",
cercago.ThreadSteerParams{
Message: cercago.F("message"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", steerResult.Status)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
steer_result = cerca.threads.steer("agent_abc123", "thread_abc123", message: "message")
puts(steer_result)cerca threads steer \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--thread-id thread_abc123 \
--message messagecurl --request POST \
--url https://api.cerca.dev/agents/{agentId}/threads/{threadId}/steer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/threads/{threadId}/steer",
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([
'message' => '<string>'
]),
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.cerca.dev/agents/{agentId}/threads/{threadId}/steer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();{
"turnId": "<string>"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Minimum string length:
1Example:
"agent_abc123"
Minimum string length:
1Example:
"thread_abc123"
Response
Thread steer result.
Available options:
enqueued, turn_started idle threads can accept a new turn or be closed. running threads have an active turn. awaiting threads are paused on external input such as approvals. closed threads are terminal.
Available options:
idle, running, awaiting, closed ⌘I