Quickstart
Create an API key, then point your OpenAI client at co/core.
Authentication
Every request needs a co/core API key in the Authorization header, using the same Bearer format as OpenAI. Keys are shown once when you create them — store yours somewhere safe.
Authorization: Bearer cocore-...
Building on top of AT Protocol? Skip key provisioning entirely: mint a service-auth token from the caller's PDS (com.atproto.server.getServiceAuth with aud=did:web:console.cocore.dev and lxm=dev.cocore.inference.dispatch) and pass it as the Bearer token. Inference then runs on behalf of the token's issuer DID. The DID must have connected co/core once so a session exists to publish the job to its PDS; otherwise the request returns 401 onboarding_required.
Invalid or missing credentials return 401 authentication_error. See HTTP errors for the full envelope.
Make a request
Point your client at https://cocore.dev/api/v1 and pass your API key. Pick a model from the directory below, or use stub while testing.
Loading the live model directory…
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://cocore.dev/api/v1",
apiKey: "cocore-...",
});
const stream = await client.chat.completions.create({
model: "stub",
messages: [{ role: "user", content: "Hello" }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}