(api_key: str, auth: str)
| 115 | |
| 116 | |
| 117 | def build_headers(api_key: str, auth: str) -> dict[str, str]: |
| 118 | headers = {"Content-Type": "application/json"} |
| 119 | if auth in ("bearer", "both"): |
| 120 | headers["Authorization"] = f"Bearer {api_key}" |
| 121 | if auth in ("x-api-key", "both"): |
| 122 | headers["x-api-key"] = api_key |
| 123 | return headers |
| 124 | |
| 125 | |
| 126 | def list_models( |