Skip to content

Use Bearer auth and refresh generated clients from latest specs#8

Merged
cretz merged 2 commits into
mainfrom
cretz/bearer-auth
Jun 5, 2026
Merged

Use Bearer auth and refresh generated clients from latest specs#8
cretz merged 2 commits into
mainfrom
cretz/bearer-auth

Conversation

@cretz

@cretz cretz commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

🚀 What

Need to use Bearer instead of Api-Key per https://docs.baseten.co/organization/api-keys#use-api-keys-with-endpoints. Also need to update API specs.

💻 How

Change to use Bearer and update spec JSON and regen

🔬 Testing

Confirm tests pass and type checking does as well

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-Key to Bearer for 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-generator compatibility) 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 marius-baseten left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rubberstamp since all generated / mechanical change.

@cretz cretz merged commit aaf3fb7 into main Jun 5, 2026
4 checks passed
@cretz cretz deleted the cretz/bearer-auth branch June 5, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants