Conversations

Managed conversations store chat history on Galliun. They require wallet authentication: the payment wallet must also sign an auth challenge.

Authenticate

const session = await client.inference.auth.ensureAuthenticated();
// session.accessToken is used on subsequent conversation calls

inferenceWallet must implement signMessage. The authenticated address must match the payment wallet.

Create and list

const created = await client.inference.conversations.create({
  title: "My chat",
});

const page = await client.inference.conversations.list({ limit: 20 });

Chat into a conversation

const response = await client.inference.chat({
  model: "openai:gpt-4o-mini",
  conversationId: created.id,
  messages: [{ role: "user", content: "Continue our discussion" }],
});

Or start persistence on a new turn:

await client.inference.chat({
  model: "openai:gpt-4o-mini",
  storeConversation: true,
  messages: [{ role: "user", content: "Remember this context" }],
});

Other helpers

await client.inference.conversations.get(id);
await client.inference.conversations.rename(id, "New title");
await client.inference.conversations.messages(id, { limit: 50 });
await client.inference.conversations.delete(id);

Managed conversation storage may add a fee line on response.cost.managedConversation.