APIPASS API Marketplace User Codex Accounts API

The User Codex Accounts API from APIPASS API Marketplace — 4 operation(s) for user codex accounts.

Operations 4

POST /api/v1/user/codex-accounts/oauth/generate-url Generate Oauth Url #
POST /api/v1/user/codex-accounts/oauth/exchange Exchange Oauth Code #
GET /api/v1/user/codex-accounts List User Accounts #
DELETE /api/v1/user/codex-accounts/{account_id} Delete User Account #

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/apipass:apipass-user-codex-accounts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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

apipass-user-codex-accounts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: ApiPass Platform User Codex Accounts API
  version: 1.0.0
tags:
- name: User Codex Accounts
paths:
  /api/v1/user/codex-accounts/oauth/generate-url:
    post:
      tags:
      - User Codex Accounts
      summary: Generate Oauth Url
      description: '生成 ChatGPT OAuth 授权 URL


        用户通过此 URL 进行 ChatGPT OAuth 授权,获取 Codex CLI 访问权限'
      operationId: generate_oauth_url_api_v1_user_codex_accounts_oauth_generate_url_post
      parameters:
      - name: authorization
        in: header
        required: true
        schema:
          type: string
          description: Bearer YOUR_API_KEY
          title: Authorization
        description: Bearer YOUR_API_KEY
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateOAuthUrlRequest'
              default: {}
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateOAuthUrlResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/user/codex-accounts/oauth/exchange:
    post:
      tags:
      - User Codex Accounts
      summary: Exchange Oauth Code
      description: '使用授权码交换 Token 并创建 Codex 账户


        流程:

        1. 验证 state 参数

        2. 检查并扣除 100 积分

        3. 使用授权码交换 tokens

        4. 创建用户专属 OpenAI 账户'
      operationId: exchange_oauth_code_api_v1_user_codex_accounts_oauth_exchange_post
      parameters:
      - name: authorization
        in: header
        required: true
        schema:
          type: string
          description: Bearer YOUR_API_KEY
          title: Authorization
        description: Bearer YOUR_API_KEY
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExchangeCodeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeCodeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/user/codex-accounts:
    get:
      tags:
      - User Codex Accounts
      summary: List User Accounts
      description: 获取用户的 Codex 账户列表
      operationId: list_user_accounts_api_v1_user_codex_accounts_get
      parameters:
      - name: authorization
        in: header
        required: true
        schema:
          type: string
          description: Bearer YOUR_API_KEY
          title: Authorization
        description: Bearer YOUR_API_KEY
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserCodexAccountListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/user/codex-accounts/{account_id}:
    delete:
      tags:
      - User Codex Accounts
      summary: Delete User Account
      description: 删除用户的 Codex 账户(只能删除属于当前用户的账户)
      operationId: delete_user_account_api_v1_user_codex_accounts__account_id__delete
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          title: Account Id
      - name: authorization
        in: header
        required: true
        schema:
          type: string
          description: Bearer YOUR_API_KEY
          title: Authorization
        description: Bearer YOUR_API_KEY
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    UserCodexAccountListResponse:
      properties:
        accounts:
          items:
            $ref: '#/components/schemas/UserCodexAccountResponse'
          type: array
          title: Accounts
        total:
          type: integer
          title: Total
      type: object
      required:
      - accounts
      - total
      title: UserCodexAccountListResponse
    ExchangeCodeResponse:
      properties:
        account_id:
          type: string
          title: Account Id
        name:
          type: string
          title: Name
        credits_deducted:
          type: number
          title: Credits Deducted
      type: object
      required:
      - account_id
      - name
      - credits_deducted
      title: ExchangeCodeResponse
    GenerateOAuthUrlRequest:
      properties:
        redirect_uri:
          anyOf:
          - type: string
          - type: 'null'
          title: Redirect Uri
          description: 自定义回调 URL(可选)
      type: object
      title: GenerateOAuthUrlRequest
    ExchangeCodeRequest:
      properties:
        code:
          type: string
          title: Code
          description: OAuth 授权码
        state:
          type: string
          title: State
          description: State 参数
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
          description: 账户名称
        redirect_uri:
          anyOf:
          - type: string
          - type: 'null'
          title: Redirect Uri
          description: 与生成 URL 时相同的 redirect_uri
      type: object
      required:
      - code
      - state
      title: ExchangeCodeRequest
    GenerateOAuthUrlResponse:
      properties:
        authorization_url:
          type: string
          title: Authorization Url
        state:
          type: string
          title: State
      type: object
      required:
      - authorization_url
      - state
      title: GenerateOAuthUrlResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserCodexAccountResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        is_active:
          type: boolean
          title: Is Active
        status:
          type: string
          title: Status
        error_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Error Message
        created_at:
          type: string
          title: Created At
        last_used_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Used At
      type: object
      required:
      - id
      - name
      - description
      - is_active
      - status
      - error_message
      - created_at
      - last_used_at
      title: UserCodexAccountResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer