codex-backend-sdk 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codex_backend_sdk/__init__.py +72 -0
- codex_backend_sdk/codex_client.py +1084 -0
- codex_backend_sdk/oauth.py +299 -0
- codex_backend_sdk/pkce.py +29 -0
- codex_backend_sdk/storage.py +166 -0
- codex_backend_sdk-0.1.1.dist-info/METADATA +369 -0
- codex_backend_sdk-0.1.1.dist-info/RECORD +9 -0
- codex_backend_sdk-0.1.1.dist-info/WHEEL +4 -0
- codex_backend_sdk-0.1.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""
|
|
2
|
+
codex-backend-sdk — Unofficial Python SDK for the ChatGPT Codex backend API.
|
|
3
|
+
|
|
4
|
+
DISCLAIMER: This is an independent, community-maintained library that
|
|
5
|
+
reverse-engineers undocumented endpoints of chatgpt.com. It is not
|
|
6
|
+
affiliated with, endorsed by, or supported by OpenAI. Use is subject
|
|
7
|
+
to OpenAI's Terms of Use (https://openai.com/policies/terms-of-use).
|
|
8
|
+
Endpoints may change or break without notice.
|
|
9
|
+
|
|
10
|
+
Quickstart:
|
|
11
|
+
from codex_backend_sdk import CodexClient
|
|
12
|
+
|
|
13
|
+
client = CodexClient().authenticate() # opens browser on first run
|
|
14
|
+
# subsequent runs load & refresh tokens automatically
|
|
15
|
+
|
|
16
|
+
for event in client.stream("Explain quicksort"):
|
|
17
|
+
...
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
__version__ = "0.1.1"
|
|
21
|
+
|
|
22
|
+
from .oauth import run_oauth_flow, refresh_access_token, obtain_api_key
|
|
23
|
+
from .storage import load_tokens, save_tokens, TokenStore
|
|
24
|
+
from .codex_client import (
|
|
25
|
+
ReasoningEffort,
|
|
26
|
+
ReasoningSummary,
|
|
27
|
+
Verbosity,
|
|
28
|
+
ServiceTier,
|
|
29
|
+
CodexClient,
|
|
30
|
+
ModelInfo,
|
|
31
|
+
ReasoningLevel,
|
|
32
|
+
TextDelta,
|
|
33
|
+
ReasoningDelta,
|
|
34
|
+
ToolCall,
|
|
35
|
+
OutputItem,
|
|
36
|
+
TokenUsage,
|
|
37
|
+
ResponseCompleted,
|
|
38
|
+
ResponseFailed,
|
|
39
|
+
ResponseAborted,
|
|
40
|
+
CompactionResult,
|
|
41
|
+
RealtimeCallResult,
|
|
42
|
+
image_url,
|
|
43
|
+
image_b64,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
__all__ = [
|
|
47
|
+
"CodexClient",
|
|
48
|
+
"ReasoningEffort",
|
|
49
|
+
"ReasoningSummary",
|
|
50
|
+
"Verbosity",
|
|
51
|
+
"ServiceTier",
|
|
52
|
+
"ModelInfo",
|
|
53
|
+
"ReasoningLevel",
|
|
54
|
+
"TextDelta",
|
|
55
|
+
"ReasoningDelta",
|
|
56
|
+
"ToolCall",
|
|
57
|
+
"OutputItem",
|
|
58
|
+
"TokenUsage",
|
|
59
|
+
"ResponseCompleted",
|
|
60
|
+
"ResponseFailed",
|
|
61
|
+
"ResponseAborted",
|
|
62
|
+
"CompactionResult",
|
|
63
|
+
"RealtimeCallResult",
|
|
64
|
+
"image_url",
|
|
65
|
+
"image_b64",
|
|
66
|
+
"run_oauth_flow",
|
|
67
|
+
"refresh_access_token",
|
|
68
|
+
"obtain_api_key",
|
|
69
|
+
"load_tokens",
|
|
70
|
+
"save_tokens",
|
|
71
|
+
"TokenStore",
|
|
72
|
+
]
|