Skip to content

feat: add --inference flag to token create command to create bearer tokens usable in the inference gateway#773

Open
shawnfeldman wants to merge 1 commit intomainfrom
shawnfeldman/add-bearer-token
Open

feat: add --inference flag to token create command to create bearer tokens usable in the inference gateway#773
shawnfeldman wants to merge 1 commit intomainfrom
shawnfeldman/add-bearer-token

Conversation

@shawnfeldman
Copy link

@shawnfeldman shawnfeldman commented Feb 27, 2026

Summary

  • Adds --inference flag to lk token create that sets an InferenceGrant{Perform: true} on the generated JWT
  • Adds "Inference" option to the interactive permission multi-select prompt

Example

$ lk token create --inference --identity inference_e2e --valid-for 60m
Using generated room name [room-12314]
valid for (mins):  60
Token grants:
{
  "room": "room-12314"
}

Access token:....

Decoded JWT payload confirms the inference grant:

{
  "identity": "inference_...",
  "inference": {
    "perform": true
  },
  "name": "inference_..",
  "video": {
    "room": "room-12314"
  }
}

Test plan

  • lk token create --inference --identity inference_e2e --valid-for 60m generates a valid JWT with inference grant
  • lk token create interactive prompt shows "Inference" as a selectable permission
  • Existing token creation flows (join, create, admin, etc.) are unaffected
  • go test ./... passes

🤖 Generated with Claude Code

Adds support for generating access tokens with InferenceGrant,
matching the token generation logic used in agent-gateway for
AI/inference endpoint authentication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link

CLAassistant commented Feb 27, 2026

CLA assistant check
All committers have signed the CLA.

@shawnfeldman shawnfeldman changed the title feat: add --inference flag to token create command feat: add --inference flag to token create command to create bearer tokens usable in the inference gateway Feb 27, 2026
Copy link
Member

@rektdeckard rektdeckard left a comment

Choose a reason for hiding this comment

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

Nice! If you want to bump the version as well, I can kick off a release for this.

Comment on lines 431 to 432
fmt.Println("Token grants:")
util.PrintJSON(grant)
Copy link
Member

Choose a reason for hiding this comment

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

This should probably print the whole ClaimGrants struct, not just the VideoGrant.

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.

4 participants