Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsMay 11, 2026·2 min de lectura

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.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Stage only · 29/100Stage only
Superficie agent
Cualquier agent MCP/CLI
Tipo
Script
Instalación
Single
Confianza
Confianza: Established
Entrada
README.md
Comando CLI universal
npx tokrepo install c0cc4d66-d935-43f1-a394-8222c4c15c31
Introducción

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.


🙏

Fuente y agradecimientos

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

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados