Skip to content

Display expires_at on API keys - #31

Merged
lavicosa merged 1 commit into
mainfrom
devin/1788960491-api-keys-expires-at
Sep 9, 2026
Merged

Display expires_at on API keys#31
lavicosa merged 1 commit into
mainfrom
devin/1788960491-api-keys-expires-at

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

The manage API now returns expires_at on both the key listing and the single-key response (see requestyai/backend@c51fb29). This surfaces it in the CLI:

  • internal/client: APIKey and APIKeyDetails decode expires_at into ExpiresAt *time.Time (omitted/nil = non-expiring key).
  • api-keys list: new EXPIRES column between LIMIT and LABELS.
  • api-keys show: new Expires field after Monthly limit.
  • --json output includes expires_at automatically via the updated structs.

A nil expiry renders as never via a new formatExpiry helper, matching the token api-keys set expiry <id> never already accepts, e.g.:

ID     NAME        SPEND   LIMIT      EXPIRES               LABELS
key-1  production  $12.50  $500.00    2026-12-31T23:59:59Z  env=prod
key-2  scratch     $0.00   unlimited  never                 -

Verified end-to-end against a stub of the manage API (list, show, and --json), plus gofmt -l ., go build, and go test ./....

Link to Devin session: https://app.devin.ai/sessions/8369a92fda714f408b04215c0511b5f6
Open in Devin Desktop: https://app.devin.ai/desktop/session/8369a92fda714f408b04215c0511b5f6?variant=devin

The manage API now returns expires_at on the key list and detail
responses. Show it as an EXPIRES column in 'api-keys list' and an
Expires field in 'api-keys show', rendering a missing value as
"never" to match 'set expiry <id> never'.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

AI Cost

No spend detected for branch devin/1788960491-api-keys-expires-at in the last 30 days.

Updated 2026-09-09T13:28Z · last 30 days · data from Requesty

@github-actions github-actions Bot added the cost:$0.00 AI cost for this branch label Sep 9, 2026
@lavicosa
lavicosa merged commit 9e15658 into main Sep 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cost:$0.00 AI cost for this branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant