Give your agent a number
A real iMessage line that customers save like any contact. Your model and code stay where they run: each text reaches your app, and Keiki delivers the reply.
import { createTurnClient, verifyKeikiDispatch } from '@onkeiki/channels'
export async function POST(req: Request) {
const request = await verifyKeikiDispatch(
{ rawBody: await req.text(), headers: req.headers },
{ signingSecret: process.env.KEIKI_SIGNING_SECRET! },
)
if (request.kind !== 'turn') return new Response(null, { status: 204 })
const { turn, turnToken } = request
const { turnUrl } = turn.keiki
const keiki = createTurnClient({ turnUrl, turnToken })
await keiki.message(await yourAgent(turn.messages), {
idempotencyKey: turn.turnId,
})
await keiki.complete({ status: 'completed' })
return new Response(null, { status: 202 })
}
Start from your stack
Bring the loop you already have, or call your Keiki agent from the SDK you already use.
import { Effect, Schema } from 'effect'
import { defineTool } from '@onkeiki/agents'
import { orders } from './store'
export const findOrder = defineTool({
name: 'find_order',
description: 'Look up a customer order.',
input: Schema.Struct({ id: Schema.String }),
execute: ({ id }) =>
Effect.promise(() => orders.get(id)),
})
Everything else you’ll need
- iMessage linesBuy a dedicated number in Keiki, import Linq lines or connect Photon.See line pricing
- Agent APICreate agents, send messages and read conversations over HTTP.Read the reference
- OpenAPI specGenerate a client in any language from one file.Get openapi.json
- WebhooksHear about every message, handoff and run as it happens.Set up webhooks
- Turn harnessesRun the loop on Keiki, on your own machine, or inside your app.Compare harnesses
- CLISign in, set up an app and open a dev tunnel from the terminal.Read the CLI docs
- llms.txtProduct instructions your own agents can read.Open llms.txt
Text your agent today.
Connect your app, give it a line, and send it the first message yourself.