Developers / SDKs

Run your first task

Submit work to Dex from Python or TypeScript, under the same workspace policy and approvals as every other surface, and retrieve the final answer and action receipts.

1. Install

The SDKs are available. Install the public package and connect it to your workspace:

Python · Shell
python -m pip install 'deixic-sdk>=0.1.3'

TypeScript · Shell
npm install '@evalops/deixic-sdk@^0.1.2'

Use Python 3.10 or later, or Node.js 20 or later for TypeScript.

2. Configure

Create a Deixic tasks token in Settings → API access. Load it and its organization and workspace IDs into your server process:

Shell
export DEIXIC_API_KEY="<task-token>"
export DEIXIC_ORGANIZATION_ID="<organization-id>"
export DEIXIC_WORKSPACE_ID="<workspace-id>"

Keep the token in your server-side secret manager and out of browser code. Your workspace needs an allowed model and a channel your token can access. Check authentication and setup.

3. Run a task

This request summarizes notes supplied in the prompt, so it needs no connected system and takes no action. Replace company with your channel ID. Use a different idempotency key for each new business request.

Python
import os
from deixic import Deixic

deixic = Deixic(
    api_key=os.environ["DEIXIC_API_KEY"],
    organization_id=os.environ["DEIXIC_ORGANIZATION_ID"],
    workspace_id=os.environ["DEIXIC_WORKSPACE_ID"],
)

task = deixic.tasks.start(
    channel_id="company",
    body="Summarize these notes: Access review found two former contractors with GitHub admin. Next: remove their access.",
    idempotency_key="quickstart-request-001",
)
result = task.wait(timeout=60)
print(result.status)
if result.status == "completed":
    print(result.body)
else:
    print(result.reason)

TypeScript
import { createDeixicClient } from "@evalops/deixic-sdk";

const deixic = createDeixicClient({
  apiKey: process.env.DEIXIC_API_KEY,
  organizationId: process.env.DEIXIC_ORGANIZATION_ID!,
  workspaceId: process.env.DEIXIC_WORKSPACE_ID!,
});

const task = await deixic.tasks.start({
  channelId: "company",
  body: "Summarize these notes: Access review found two former contractors with GitHub admin. Next: remove their access.",
  idempotencyKey: "quickstart-request-001",
});
const result = await task.wait({ timeoutMs: 60_000 });
console.log(result.status);
if (result.status === "completed") {
  console.log(result.body);
} else {
  console.log(result.reason);
}

Save the Python example as task.py and run python task.py. Save the TypeScript example as task.mts and run npx tsx task.mts in Node.js.

4. Read the result

On completion, the example prints completed followed by Dex's final answer. wait retrieves the answer linked to the accepted turn, together with its referenced receipts.

If the task needs approval, fails, or exceeds the 60-second observation budget, the example prints its status and reason. An unfinished result means observation ended; remote work continues. Handle each outcome.

This first example keeps its task handle in memory. For a worker that restarts, save a checkpoint before submitting. Recover the same request using its original key and body.

Request an account briefInstalled example: read connected CRM data and retrieve the brief from a separate process.Recover after a restartSave progress and retrieve the same task without submitting it again.Tasks and resultsChoose a method and handle results, receipts, and approvals.