Use Bearer auth and refresh generated clients from latest specs#8
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Baseten Python SDK to use Authorization: Bearer <api_key> and refreshes the generated Management API/client code from the latest upstream specs, along with corresponding dependency/tooling adjustments.
Changes:
- Switch Authorization header scheme from
Api-KeytoBearerfor management and inference clients (and update tests accordingly). - Refresh OpenAPI/JSON schema specs and regenerate Management API + modelconfig generated code.
- Pin/adjust dev tooling versions (notably
datamodel-code-generatorcompatibility) and apply model postprocessing during codegen.
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updates dev dependency constraints and lock entries (ruff/ty and datamodel-code-generator cap). |
| pyproject.toml | Caps datamodel-code-generator and bumps ruff/ty to keep generated code type-checkable. |
| tests/client/test_management.py | Updates expected Authorization header to Bearer. |
| tests/client/test_inference.py | Updates expected Authorization header to Bearer. |
| scripts/apigen/specs/inference.json | Refreshes inference spec content/formatting. |
| scripts/apigen/specs/config.schema.json | Adds loops_checkpoint_ids to schema. |
| scripts/apigen/main.py | Applies postprocessing to generated API models during codegen. |
| baseten/client/modelconfig/_models.py | Regenerated modelconfig models (adds loops_checkpoint_ids). |
| baseten/client/managementapi/_models.py | Regenerated Management API models from updated specs. |
| baseten/client/managementapi/_client.py | Regenerated Management API client with new endpoints/types; adds several new methods. |
| baseten/client/managementapi/init.py | Updates re-exports for regenerated Management API surface. |
| baseten/client/_management.py | Switches request auth header to Bearer. |
| baseten/client/_inference.py | Switches request auth header to Bearer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ), | ||
| ) | ||
|
|
||
| def get_loops_sessions(self, *, session_id: str) -> GetLoopsSessionResponse: |
| ), | ||
| ) | ||
|
|
||
| async def get_loops_sessions(self, *, session_id: str) -> GetLoopsSessionResponse: |
| ), | ||
| ) | ||
|
|
||
| def get_users(self, *, user_id: str) -> UserInfo: |
| ), | ||
| ) | ||
|
|
||
| async def get_users(self, *, user_id: str) -> UserInfo: |
Comment on lines
+247
to
+254
| class Name(Enum): | ||
| CREATED = "CREATED" | ||
| DEPLOYING = "DEPLOYING" | ||
| RUNNING = "RUNNING" | ||
| SCALED_TO_ZERO = "SCALED_TO_ZERO" | ||
| FAILED = "FAILED" | ||
| STOPPED = "STOPPED" | ||
|
|
marius-baseten
approved these changes
Jun 4, 2026
marius-baseten
left a comment
There was a problem hiding this comment.
Rubberstamp since all generated / mechanical change.
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.
🚀 What
Need to use
Bearerinstead ofApi-Keyper https://docs.baseten.co/organization/api-keys#use-api-keys-with-endpoints. Also need to update API specs.💻 How
Change to use
Bearerand update spec JSON and regen🔬 Testing
Confirm tests pass and type checking does as well