Terminal Use CLI Authentication API

The CLI Authentication API from Terminal Use — 2 operation(s) for cli authentication.

Operations 2

POST /v1/auth/cli/refresh Refresh Cli Token #
POST /v1/auth/cli/token Exchange Cli Token #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/terminal-use-cli-authentication-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

terminal-use-cli-authentication-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sb0 Agent APIKeys CLI Authentication API
  version: 0.1.0
servers:
- url: https://api.terminaluse.com
  description: Base URL declared by the provider in apis.yml (roadmap#122).
tags:
- name: CLI Authentication
paths:
  /v1/auth/cli/refresh:
    post:
      description: 'Refresh an expired session JWT using a refresh token.


        Note: Refresh tokens are single-use. The response contains a new refresh_token

        that must replace the old one for future refresh operations.'
      operationId: refresh_cli_token_v1_auth_cli_refresh_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CLIRefreshRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CLIRefreshResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Refresh Cli Token
      tags:
      - CLI Authentication
  /v1/auth/cli/token:
    post:
      description: Exchange authorization code for session JWT using PKCE.
      operationId: exchange_cli_token_v1_auth_cli_token_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CLITokenRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CLITokenResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Exchange Cli Token
      tags:
      - CLI Authentication
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CLIRefreshResponse:
      description: Response for CLI token refresh.
      properties:
        expires_in:
          description: Token expiration in seconds
          title: Expires In
          type: integer
        refresh_token:
          description: New refresh token (replaces the old one)
          title: Refresh Token
          type: string
        session_jwt:
          description: New session JWT (WorkOS access token)
          title: Session Jwt
          type: string
      required:
      - session_jwt
      - refresh_token
      - expires_in
      title: CLIRefreshResponse
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
      - loc
      - msg
      - type
      title: ValidationError
      type: object
    CLITokenRequest:
      description: Request body for CLI token exchange with PKCE.
      properties:
        code:
          description: Authorization code from OAuth callback
          title: Code
          type: string
        code_verifier:
          description: PKCE code verifier
          title: Code Verifier
          type: string
      required:
      - code
      - code_verifier
      title: CLITokenRequest
      type: object
    CLIRefreshRequest:
      description: Request body for CLI token refresh.
      properties:
        refresh_token:
          description: Refresh token from previous authentication
          title: Refresh Token
          type: string
      required:
      - refresh_token
      title: CLIRefreshRequest
      type: object
    CLITokenResponse:
      description: Response for CLI token exchange.
      properties:
        email:
          anyOf:
          - type: string
          - type: 'null'
          description: User email
          title: Email
        expires_in:
          description: Token expiration in seconds
          title: Expires In
          type: integer
        member_id:
          anyOf:
          - type: string
          - type: 'null'
          description: User ID from WorkOS
          title: Member Id
        name:
          anyOf:
          - type: string
          - type: 'null'
          description: User display name
          title: Name
        org_id:
          anyOf:
          - type: string
          - type: 'null'
          description: Organization ID (if applicable)
          title: Org Id
        refresh_token:
          anyOf:
          - type: string
          - type: 'null'
          description: Refresh token for obtaining new access tokens
          title: Refresh Token
        session_jwt:
          description: Session JWT (WorkOS access token)
          title: Session Jwt
          type: string
      required:
      - session_jwt
      - expires_in
      title: CLITokenResponse
      type: object
x-fern-idempotency-headers:
- header: Idempotency-Key
  name: idempotency_key