ResourcesAI Tools

AI Tools

Improve and translate prompts, generate opportunity and success criteria, run LLM chat completions, and manage personal prompt presets through the Talkturo API.

curl https://api.talkturo.com/api/improve-prompt \
  -X POST \
  -H "Authorization: Bearer tk_live_example_7xk2m9q4" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Write a better onboarding email for new customers."
  }'
{
  "text": "Write a welcoming onboarding email for new customers that explains the first three steps they should take."
}
curl https://api.talkturo.com/api/translate-prompt \
  -X POST \
  -H "Authorization: Bearer tk_live_example_7xk2m9q4" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Schedule a follow-up call with the customer next week.",
    "targetLanguage": "German"
  }'
{
  "text": "Planen Sie für nächste Woche einen Folgeanruf mit dem Kunden."
}
curl https://api.talkturo.com/api/generate-opportunity-prompt \
  -X POST \
  -H "Authorization: Bearer tk_live_example_7xk2m9q4" \
  -H "Content-Type: application/json" \
  -d '{
    "systemPrompt": "Identify opportunities to improve customer retention during support conversations."
  }'
{
  "text": "Look for statements that indicate churn risk, unresolved concerns, or opportunities to increase customer value."
}
curl "https://api.talkturo.com/api/generate-success-prompt?accountSlug=acme-sales" \
  -X POST \
  -H "Authorization: Bearer tk_live_example_7xk2m9q4" \
  -H "Content-Type: application/json" \
  -d '{
    "systemPrompt": "Define what a successful customer onboarding conversation should accomplish."
  }'
{
  "text": "A successful onboarding conversation confirms the customer's goals, explains the next steps, and identifies any unresolved blockers."
}
curl https://api.talkturo.com/api/llm/chat \
  -X POST \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "system",
        "content": "You summarize sales conversations for account executives."
      },
      {
        "role": "user",
        "content": "Summarize the next steps from the conversation."
      }
    ],
    "temperature": 0.2
  }'
{
  "id": "chatcmpl_example_8f21",
  "object": "chat.completion",
  "created": 1760380800,
  "model": "gpt-4o-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The next steps are to confirm the implementation timeline, send the integration checklist, and schedule a technical review."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 24,
    "total_tokens": 66
  }
}
curl https://api.talkturo.com/api/prompt-presets \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example"
{
  "success": true,
  "data": {
    "presets": [
      {
        "id": "preset_4f8b2c1d",
        "user_id": "user_91a2b3c4",
        "uid": "user_91a2b3c4",
        "title": "Summarize sales calls",
        "prompt": "Summarize the customer's goals, objections, and next steps.",
        "is_default": 0,
        "is_template": 0,
        "created_at": "2026-01-14T10:30:00.000Z",
        "updated_at": "2026-01-14T10:30:00.000Z"
      }
    ]
  }
}
curl https://api.talkturo.com/api/prompt-presets \
  -X POST \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Extract renewal risks",
    "prompt": "Identify renewal risks, supporting evidence, and recommended follow-up actions."
  }'
{
  "success": true,
  "data": {
    "preset": {
      "id": "preset_8d7e6f5a",
      "user_id": "user_91a2b3c4",
      "uid": "user_91a2b3c4",
      "title": "Extract renewal risks",
      "prompt": "Identify renewal risks, supporting evidence, and recommended follow-up actions.",
      "is_default": 0,
      "is_template": 0,
      "created_at": "2026-01-14T11:00:00.000Z",
      "updated_at": "2026-01-14T11:00:00.000Z"
    }
  }
}
curl https://api.talkturo.com/api/prompt-presets/preset_8d7e6f5a \
  -X PUT \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Identify renewal risks, supporting evidence, recommended follow-up actions, and the customer owner."
  }'
{
  "success": true,
  "data": {
    "preset": {
      "id": "preset_8d7e6f5a",
      "user_id": "user_91a2b3c4",
      "uid": "user_91a2b3c4",
      "title": "Extract renewal risks",
      "prompt": "Identify renewal risks, supporting evidence, recommended follow-up actions, and the customer owner.",
      "is_default": 0,
      "is_template": 0,
      "created_at": "2026-01-14T11:00:00.000Z",
      "updated_at": "2026-01-14T11:12:00.000Z"
    }
  }
}
curl https://api.talkturo.com/api/prompt-presets/preset_8d7e6f5a \
  -X DELETE \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example"
{
  "success": true,
  "data": {
    "changes": 1
  }
}
curl https://api.talkturo.com/api/prompt-presets/templates \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example"
{
  "success": true,
  "data": {
    "templates": []
  }
}

AI tools and prompt utilities

Use these endpoints to improve prompts, translate prompt text, generate opportunity and success prompts, call approved language models, and manage personal prompt presets.

The prompt utility endpoints accept a Talkturo API key or a Supabase session token. The chat completion and prompt preset endpoints require a Desktop JWT.

Authentication

Use this authentication mode for prompt improvement, translation, and prompt generation endpoints.

curl https://api.talkturo.com/api/improve-prompt \
  -X POST \
  -H "Authorization: Bearer tk_live_example_7xk2m9q4" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Help me write a concise follow-up email after a product demo."
  }'

Talkturo accepts a Talkturo API key, a Supabase bearer session token, or a cookie-based Supabase session. These endpoints do not require an account identifier unless the authentication wrapper requires one for the selected session context.

Improve a prompt

POST /api/improve-prompt rewrites a prompt for clarity while keeping the result in the detected input language.

Request

body
promptstring
Required
The prompt to improve. The endpoint requires a truthy value.

Response

textstring
Required
The improved prompt text.
curl https://api.talkturo.com/api/improve-prompt \
  -X POST \
  -H "Authorization: Bearer tk_live_example_7xk2m9q4" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Write a better onboarding email for new customers."
  }'

A missing prompt returns 400. Failures while generating the improved prompt return 500.

Translate a prompt

POST /api/translate-prompt translates a prompt into the requested language.

Request

body
promptstring
Required
The prompt to translate. The endpoint requires a truthy value.
body
targetLanguagestring
Required
The destination language. You can provide a language name such as German or a language code such as de.

Response

textstring
Required
The translated prompt text.
curl https://api.talkturo.com/api/translate-prompt \
  -X POST \
  -H "Authorization: Bearer tk_live_example_7xk2m9q4" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Schedule a follow-up call with the customer next week.",
    "targetLanguage": "German"
  }'

A missing prompt or target language returns 400. Translation failures return 500.

Generate opportunity prompts

POST /api/generate-opportunity-prompt generates an opportunity prompt from a system prompt.

Request

body
systemPromptstring
Required
The system prompt that defines how the opportunity prompt should be generated.

Response

textstring
Required
The generated opportunity prompt.

Generate success prompts

POST /api/generate-success-prompt generates a success definition from a system prompt.

Request

body
systemPromptstring
Required
The system prompt that defines the success criteria to generate.
query
accountSlugstring
The account slug required by the authentication wrapper for some session-token requests. It is not used to generate the prompt.

Response

textstring
Required
The generated success definition.

API-key callers authenticate with the key's bound account. Session-token callers may need to provide accountSlug. Cookie-session callers may provide accountSlug or teamId as required by the authentication context.

Run chat completions

POST /api/llm/chat provides an OpenAI-compatible chat completion endpoint for Talkturo Desktop clients. The endpoint requires a Desktop JWT and forwards supported request options to the upstream model provider.

Request

body
modelstring
Required
The model to use. The value must be in the allow-list. Models ending in -proxied use the corresponding model name without that suffix upstream.
Allowed values:gpt-4.1gpt-4.1-proxiedgpt-4ogpt-4o-proxiedgpt-4o-minigpt-4o-mini-proxiedgpt-4.1-nanogpt-4.1-nano-proxiedgpt-5-nanogpt-5-nano-proxiedgpt-4o-mini-transcribe
body
messagesarray
Required
A non-empty array of OpenAI-compatible chat messages.
body
streamboolean
When true, returns an SSE stream. Defaults to false.
body
temperaturenumber
An OpenAI chat-completion option forwarded to the upstream provider.

Other OpenAI chat-completion options are forwarded unchanged when supported by the upstream provider.

Non-streaming response

idstring
Required
The upstream completion identifier.
objectstring
Required
The upstream object type, normally chat.completion for non-streaming responses.
createdinteger
Required
The Unix timestamp for the completion.
modelstring
Required
The model used for the completion.
choicesarray
Required
The generated completion choices, including each message and finish reason.
usageobject
Token usage reported by the upstream provider.
curl https://api.talkturo.com/api/llm/chat \
  -X POST \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "Summarize the next steps from the conversation."
      }
    ]
  }'

Streaming response

Set stream to true to receive an SSE response.

const response = await fetch("https://api.talkturo.com/api/llm/chat", {
  method: "POST",
  headers: {
    Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    model: "gpt-4o-mini",
    messages: [
      {
        role: "user",
        content: "Summarize the next steps from the conversation."
      }
    ],
    stream: true
  })
});

if (!response.ok || !response.body) {
  throw new Error(`Request failed with status ${response.status}`);
}

for await (const chunk of response.body) {
  process.stdout.write(new TextDecoder().decode(chunk));
}

The stream uses text/event-stream and contains upstream events in the following format:

data: { ...chunk... }

data: [DONE]

A disallowed model, invalid JSON, or missing messages returns 400. Missing server configuration returns 500. Upstream connection failures return 502.

Manage prompt presets

Prompt presets are personal, reusable prompts managed through the Desktop API. All preset endpoints require a Desktop JWT.

List presets

GET /api/prompt-presets returns the authenticated user's presets. Results are sorted by default status descending and title ascending.

successboolean
Required
Indicates whether the request succeeded.
data.presetsarray
Required
The authenticated user's prompt presets.
data.presets[].idstring
Required
The preset identifier.
data.presets[].user_idstring
Required
The user who owns the preset.
data.presets[].uidstring
Legacy alias for user_id.
data.presets[].titlestring
Required
The preset title.
data.presets[].promptstring
Required
The reusable prompt text.
data.presets[].is_defaultinteger
Required
1 for a default preset and 0 otherwise.
data.presets[].is_templateinteger
Required
1 for a template and 0 otherwise.
data.presets[].created_atstring
Required
The creation timestamp.
data.presets[].updated_atstring
Required
The last update timestamp.

Create a preset

POST /api/prompt-presets creates a personal preset.

body
titlestring
Required
The preset title.
body
promptstring
Required
The reusable prompt text.

Update a preset

PUT /api/prompt-presets/{id} updates a personal, non-default preset.

path
idstring
Required
The preset identifier.
body
titlestring
A replacement title.
body
promptstring
Replacement prompt text.

At least one of title or prompt must be truthy. Empty strings cannot clear a field. The endpoint only updates presets owned by the authenticated user where is_default is false.

Delete a preset

DELETE /api/prompt-presets/{id} deletes a personal, non-default preset.

path
idstring
Required
The preset identifier.
successboolean
Required
Indicates whether the request succeeded.
data.changesinteger
Required
The number of deleted records, normally 1.

List prompt templates

GET /api/prompt-presets/templates returns the available prompt templates.

successboolean
Required
Indicates whether the request succeeded.
data.templatesarray
Required
The available templates. This endpoint currently returns an empty array.

Default presets and templates cannot be updated or deleted through the personal preset endpoints. Attempts to access a missing, unauthorized, default, or template preset return 404.

Was this page helpful?