SDKs

Cortex SDKs wrap the HTTP API for application developers.

TypeScript

const cortex = new CortexClient({ apiKey });
const thread = await cortex.threads.create();
const run = await cortex.messages.create(thread.id, {
  content: "Create a launch plan from this brief"
});
for await (const event of cortex.runs.stream(thread.id, run.id)) {
  console.log(event);
}

Python

client = Cortex(api_key=api_key)
thread = client.threads.create()
run = client.messages.create(
    thread.id,
    content="Create a launch plan from this brief",
)
for event in client.runs.stream(thread.id, run.id):
    print(event)