Issue a bot challenge
Generates a reverse-CAPTCHA challenge used to gate the bot signup flow. A random active problem is selected from the pool; math problems are returned obfuscated (case randomization, symbol injection, spacing noise) with an unobfuscated rounding instruction appended, while string and binary problems are returned as-is. The response contains a single-use nonce, the problem text, and the current terms-and-conditions and privacy-policy URLs, which must be echoed back on the signup request. Challenges expire after a short window (10 minutes by default) and can only be answered once. This endpoint is public and unauthenticated.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const BotChallenge = await client.botChallenge.create();
console.log(BotChallenge.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
bot_challenge = client.bot_challenge.create()
print(bot_challenge.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
botChallenge, err := client.BotChallenge.New(
context.TODO(),
telnyx.BotChallengeNewParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", botChallenge.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.botChallenge.BotChallengeCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
BotChallengeCreateParams params = BotChallengeCreateParams.builder()
.build();
var response = client.botChallenge().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
bot_challenge = telnyx.bot_challenge.create
puts(bot_challenge)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$bot_challenge = $client->botChallenge->create();
var_dump($bot_challenge);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx bot-challenge create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/bot_challenge \
--header 'Content-Type: application/json' \
--data '
{
"llm_model_name": "claude-opus-4",
"llm_parameter_count": "175B",
"llm_quantization": "int8"
}
'{
"data": {
"nonce": "c6feda4e-6501-4db9-a21f-665e5b4ce2ba",
"problem": "W#hAt iS f!Ve tImEs sEvEn? Round to 0 decimal places. Omit units.",
"challenge_type": "math",
"precision": 0,
"terms_and_conditions_url": "https://telnyx.com/terms-and-conditions-of-service",
"privacy_policy_url": "https://telnyx.com/privacy-policy"
}
}{
"errors": [
{
"detail": "There was a problem in the JSON you submitted. Please check your formatting and try again."
}
]
}{
"errors": [
{
"detail": "No bot challenge problems available"
}
]
}Body
Optional self-reported metadata about the LLM solving the challenge. Used for analytics only; it does not influence which problem is served.
Optional self-reported metadata about the LLM solving the challenge. Analytics only; values are truncated to 50 characters.
Response
Challenge issued.
Show child attributes
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const BotChallenge = await client.botChallenge.create();
console.log(BotChallenge.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
bot_challenge = client.bot_challenge.create()
print(bot_challenge.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
botChallenge, err := client.BotChallenge.New(
context.TODO(),
telnyx.BotChallengeNewParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", botChallenge.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.botChallenge.BotChallengeCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
BotChallengeCreateParams params = BotChallengeCreateParams.builder()
.build();
var response = client.botChallenge().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
bot_challenge = telnyx.bot_challenge.create
puts(bot_challenge)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$bot_challenge = $client->botChallenge->create();
var_dump($bot_challenge);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx bot-challenge create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/bot_challenge \
--header 'Content-Type: application/json' \
--data '
{
"llm_model_name": "claude-opus-4",
"llm_parameter_count": "175B",
"llm_quantization": "int8"
}
'{
"data": {
"nonce": "c6feda4e-6501-4db9-a21f-665e5b4ce2ba",
"problem": "W#hAt iS f!Ve tImEs sEvEn? Round to 0 decimal places. Omit units.",
"challenge_type": "math",
"precision": 0,
"terms_and_conditions_url": "https://telnyx.com/terms-and-conditions-of-service",
"privacy_policy_url": "https://telnyx.com/privacy-policy"
}
}{
"errors": [
{
"detail": "There was a problem in the JSON you submitted. Please check your formatting and try again."
}
]
}{
"errors": [
{
"detail": "No bot challenge problems available"
}
]
}