Get Agent Api Key
Changed onReturn metadata for the agent's currently active API key.
Returns the public-safe prefix and a display-only masked_key. The plaintext secret is unrecoverable by design -- if the owner has lost it, they must POST to rotate.
Args: agent_id: Path parameter. current_user: Resolved from JWT. db: SQLAlchemy session.
Returns: :class:APIKeyMetadataResponse with key_prefix, masked_key, and created_at.
Raises: HTTPException 401: missing or invalid JWT. HTTPException 404: agent missing / not owned; or owned but has no active key. Both shapes use the same status code so the caller cannot distinguish "agent doesn't exist" from "no key generated yet". The detail differentiates so the UI can render "未生成" instead of "agent not found".
Request
- The document declares no server URL.
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Response
Successful Response
Changes
- info
endpoint added
- info