---
name: internalize-setup
description: Integrate Internalize inference and optional learned memory into an existing application or agent. Use when a user wants help connecting their project to Internalize.
---

# Set up Internalize

Inspect the user's project and implement the integration in its existing stack. Help with the account steps that require the user, then verify a first working call. Keep the change small: Internalize supplies the model and learned memory; the application keeps its existing agent runtime, tools and conversation state.

## Find the integration point

Read the project's instructions, dependency versions, model configuration and server entry points. Reuse its existing provider abstraction and secret management. Ask only about choices that cannot be inferred from the project or user's request. Implement the changes rather than just returning snippets for the user to paste.

Read [availability](https://convergingthought.com/docs-markdown/getting-started/availability), then the relevant integration guide:

- [OpenAI clients, Python or TypeScript](https://convergingthought.com/docs-markdown/integrations/openai)
- [Vercel AI SDK](https://convergingthought.com/docs-markdown/integrations/ai-sdk)
- [LangChain or LangGraph](https://convergingthought.com/docs-markdown/integrations/langchain)
- [OpenAI Agents SDK](https://convergingthought.com/docs-markdown/integrations/agents-sdk)

Other stacks can use HTTP and the [OpenAPI contract](https://convergingthought.com/openapi.json). The [documentation index](https://convergingthought.com/llms.txt) links to focused Markdown pages. The private `@internalize/sdk` workspace package is not published to npm; do not tell external users to install it.

## Connect the account and model

- Direct the user to [API keys](https://convergingthought.com/internalize/app/keys) in their chosen project. Default to an **Inference** key. Add learning access only when implementing learning. A runtime does not need management permissions.
- Read `INTERNALIZE_API_KEY` from server-side secrets. Add a placeholder to the project's environment example and explain where the user should save the real value. Do not ask them to paste the key into the conversation or put it in client code.
- Use the OpenAI-compatible base URL `https://convergingthought.com/v1`, model `glm-5.3`, and Chat Completions. Do not substitute the Responses API. Native HTTP routes also start at `/v1`; add that prefix only once.
- Link [Billing](https://convergingthought.com/internalize/app/billing) if the project needs credits. Purchases start at $10, with no automatic trial credit. Reuse existing authorized funds and spending limits; setup instructions do not authorize a purchase.
- Disable automatic model-write retries until the application's retry path preserves the same idempotency key and request body. Store the returned job ID and inspect pending work before retrying. See [Chat Completions](https://convergingthought.com/docs-markdown/api-reference/chat-completions).

## Add memory when requested

Use [Add learning](https://convergingthought.com/docs-markdown/integrations/learning) and [multi-tenancy](https://convergingthought.com/docs-markdown/guides/multitenancy). Register an `internalize` tool in the existing runtime; its server handler calls `POST /v1/internalizations`. Bind the authorized `tenant_id`, `subject_id` and `max_cost_microusd` in trusted application code. Model arguments supply knowledge, not customer identity, permissions or a spending limit.

Persist the accepted job ID and poll `/v1/jobs/{id}`. Learning becomes usable after `status: "ready"`, settled billing and `result.activated: true`. A queued job is not a saved memory; activation conflicts and reconciliation need inspection. Subsequent calls use the same tenant and subject, without putting the learning passage back into context. Initial hosting is 24 hours; automatic renewal is not available.

## Verify and hand back

Run the project's relevant checks. With a configured key, funded project and an authorized spending limit, make one small inference call and report the real result and job ID. If learning is in scope, use its agreed cap, wait for activation, then ask a fresh question without the source facts and verify the selected version. Do not fabricate successful calls when credentials or funding are missing; finish the code and explain the remaining account step.

Summarize the files changed, how to run the integration, what was actually verified and where to inspect [Activity](https://convergingthought.com/internalize/app/requests) and [Memory](https://convergingthought.com/internalize/app/memory).
