scorpiox-codex-fetchtoken AI Provider

Fetch Codex/OpenAI OAuth token from local or remote

● Linux x64 ● Linux ARM64 ● macOS ARM64 ● Windows x64

Description

scorpiox-codex-fetchtoken retrieves OAuth tokens for Codex and OpenAI services. It can fetch tokens from a locally cached credential store or request a fresh token from a remote OAuth endpoint. This is typically used by other ScorpioX tools that need authenticated access to Codex/OpenAI APIs.

Flags & Options

Flag Short Description Takes Value
--verbose Enable verbose output showing token fetch steps, HTTP requests, and cache lookups for debugging authentication issues No

Usage Examples

# Fetch the current OAuth token (uses local cache if valid) $ scorpiox-codex-fetchtoken eyJhbGciOiJSUzI1NiIs...<truncated>
# Fetch with verbose output to debug auth issues $ scorpiox-codex-fetchtoken --verbose [info] checking local token cache ~/.scorpiox/tokens/codex.json [info] cached token expired at 2026-05-29T08:12:00Z [info] requesting fresh token from OAuth endpoint... [info] POST https://auth.openai.com/oauth/token → 200 OK [info] token cached, expires in 3600s eyJhbGciOiJSUzI1NiIs...<truncated>
# Pipe the token directly into an API request $ curl -s -H "Authorization: Bearer $(scorpiox-codex-fetchtoken)" \ https://api.openai.com/v1/models
# Use in a script with other ScorpioX tools $ export OPENAI_TOKEN=$(scorpiox-codex-fetchtoken) $ scorpiox-openai --token "$OPENAI_TOKEN" --prompt "Hello"
# Refresh a stale token and verify $ scorpiox-codex-refreshtoken $ scorpiox-codex-fetchtoken --verbose [info] checking local token cache ~/.scorpiox/tokens/codex.json [info] cached token valid, expires in 3542s eyJhbGciOiJSUzI1NiIs...<truncated>

Source & Build Info

Source File
scorpiox/scorpiox-codex-fetchtoken.c
Lines of Code
677
Dependencies
libcurl · libsxnet · libsxutil · yyjson

Related Tools