pai
    Preparing search index...

    Function claudeProvider

    • Point Claude Code's own model calls at Phantom AI, so its main loop spends a Phantom key. Written to the env block and apiKeyHelper of ~/.claude/settings.json, keeping everything else in the file.

      The key is not copied into the file: apiKeyHelper runs pai key show, which prints whichever key pai would use, so a login or rotate carries over. ENABLE_TOOL_SEARCH is on because Claude Code turns tool search off for any base URL that isn't Anthropic's, and without it every MCP tool's schema goes into every request: about 200k tokens on a setup with many servers, which is past the context of most models.

      Parameters

      • env: Env
      • opts: { model?: string; off?: boolean; onPath?: (bin: string) => boolean } = {}

      Returns ProviderResult