poe_auth
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| PoeAuthBackend llmling_models.auth.poe_auth Poe OAuth / API key auth backend. |
||
| PoeTokenStore llmling_models.auth.poe_auth File-based storage for Poe API key. |
🛈 DocStrings¶
Poe OAuth authentication.
OAuth PKCE flow for Poe (poe.com) which returns an API key. The API key can also be entered manually as a fallback.
Manage your API keys at: https://poe.com/api_key
PoeAuthBackend
¶
Bases: ProviderAuthBackend
Poe OAuth / API key auth backend.
Source code in src/llmling_models/auth/poe_auth.py
PoeTokenStore
¶
File-based storage for Poe API key.
Source code in src/llmling_models/auth/poe_auth.py
clear
¶
load
¶
Load stored API key.
Source code in src/llmling_models/auth/poe_auth.py
save
¶
Save API key.
authenticate_poe
¶
Run the full Poe authentication flow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manual_key
|
str | None
|
If provided, skip OAuth and use this API key directly. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The API key. |
Source code in src/llmling_models/auth/poe_auth.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
build_authorization_url
¶
exchange_code_for_token
¶
Exchange authorization code for API key.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict with 'api_key' and optionally 'expires_in'. |
Source code in src/llmling_models/auth/poe_auth.py
generate_pkce
¶
Generate PKCE verifier and challenge.
Source code in src/llmling_models/auth/poe_auth.py
poe_auth_main
¶
Command-line entry point for Poe authentication.
Source code in src/llmling_models/auth/poe_auth.py
validate_poe_key
¶
Validate a Poe API key by fetching models.