Clarify Prime Inference OpenAI auth setup#735
Open
d42me wants to merge 3 commits into
Open
Conversation
20d9db7 to
e3a8b69
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e3a8b69. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
primepackage export so examples can usefrom prime import ConfigConfig.inference_headersfor OpenAIdefault_headers, including active team context viaX-Prime-Team-IDprime login/ active config and process-scopedPRIME_API_KEYoverridesTests
from prime import Configdefault_headers=prime.inference_headersPRIME_API_KEYPRIME_TEAM_IDPRIME_TEAM_ID=ci-team uv run pytest packages/prime/tests/test_inference_config.py -quv run ruff check packages/prime/src/prime packages/prime/src/prime_cli/core/config.py packages/prime/tests/test_inference_config.py packages/prime-evals/examples/basic_usage.py packages/prime-sandboxes/examples/basic_usage.py packages/prime-sandboxes/examples/async_background.pyHow it works now
Library code can use Prime Inference with the standard OpenAI client and the active
prime logincontext:prime.inference_headersexposes the active team context as OpenAIdefault_headers(X-Prime-Team-ID) when a team is selected viaprime switchorPRIME_TEAM_ID.PRIME_API_KEYstill works, but as an explicit per-process/project override rather than something users need to export globally.Note
Low Risk
Small additive SDK surface and documentation; inference headers only attach team context when configured, with unit tests.
Overview
Adds a
primePython package that re-exportsConfigso apps can usefrom prime import Config, and addsConfig.inference_headersfor OpenAI-compatible Prime Inference clients (X-Prime-Team-IDfrom active team /PRIME_TEAM_ID).Docs and examples now steer users toward
prime login/ active config and process-scopedPRIME_API_KEYinstead of global exports or inline API keys, including new OpenAI +Configsnippets in the root andpackages/primeREADMEs.pyproject.tomlincludessrc/primein the wheel; tests cover the export and inference header behavior.Reviewed by Cursor Bugbot for commit e967f2b. Bugbot is set up for automated code reviews on this repo. Configure here.