Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 11, 2026·2 min de lecture

openai-python — Official OpenAI Python SDK

Call the OpenAI REST API from Python 3.9+ with typed request/response models and sync/async clients. Use it as a core SDK for agents and app backends.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Stage only · 29/100Stage only
Surface agent
Tout agent MCP/CLI
Type
Script
Installation
Single
Confiance
Confiance : Established
Point d'entrée
README.md
Commande CLI universelle
npx tokrepo install c0cc4d66-d935-43f1-a394-8222c4c15c31
Introduction

Call the OpenAI REST API from Python 3.9+ with typed request/response models and sync/async clients. Use it as a core SDK for agents and app backends.

  • Best for: Python developers building LLM apps who want typed clients and a stable upgrade path
  • Works with: Python 3.9+, OpenAI API, httpx-powered sync/async clients
  • Setup time: 6 minutes

Quantitative Notes

  • Setup time ~6 minutes (pip install + set API key + one request)
  • GitHub stars + forks (verified): see Source & Thanks
  • Python requirement: 3.9+ (repo README)

Practical Notes

Keep SDK usage behind a thin adapter in your codebase (one module) so upgrades don’t ripple through your app. Centralize timeouts/retries and log request IDs. For agents, restrict tool schemas and validate all model outputs before execution.

Safety note: Never hardcode API keys; use env vars/secret managers and scrub logs.

FAQ

Q: Do I need an API key to import it? A: No. You can import and build clients without a key; you need a key to call the API.

Q: Does it support async? A: Yes. The library provides synchronous and asynchronous clients.

Q: How do I manage rate limits? A: Use retries/backoff, batch where possible, and log request IDs for debugging.


🙏

Source et remerciements

GitHub: https://github.com/openai/openai-python Owner avatar: https://avatars.githubusercontent.com/u/14957082?v=4 License (SPDX): Apache-2.0 GitHub stars (verified via api.github.com/repos/openai/openai-python): 30,747 GitHub forks (verified via api.github.com/repos/openai/openai-python): 4,777

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires