Skip to main content

Polling OpenAI API without rate limit issues.

Project description

OpenAI-API-Polling

Polling OpenAI API without rate limit issues.

Quickly Start

You can use pip to install this package.

pip install openai-api-polling

A simple example:

from openai_api_polling.polling import ClientPolling

api_keys = [
    "<your api key a>", 
    "<your api key> b",
    "<your api key> c",
]
client_polling = ClientPolling(api_keys=api_keys)

for _ in range(10):
    resp = client_polling.client.chat.completions.create(
        model="gpt-4",
        messages=[
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Hello! Explain the core of Game Theory."},
        ]
    )
    print(resp.choices[0].message.content)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openai_api_polling-0.1.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openai_api_polling-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file openai_api_polling-0.1.0.tar.gz.

File metadata

  • Download URL: openai_api_polling-0.1.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for openai_api_polling-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fb18200141fbd8c4ca442e993224a45a67d266a0e4d193a004be00a9f7c71bb3
MD5 86c79188358794a4eb49e452555df42f
BLAKE2b-256 81f7203ba0eebb3057742e069a7fe587228e0e5acee4c9c7ef18a9d4f2da3c3e

See more details on using hashes here.

File details

Details for the file openai_api_polling-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: openai_api_polling-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for openai_api_polling-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7c884a79dfb27e2ed0123b63b2bb33fee5633429db507073313e8662c7d5930
MD5 81f68f9cb3715c4ff7e4d002deacd0fc
BLAKE2b-256 9bcb1ed12c0acb1d7478b87e22a8286c02eae4f9e8b73b53edaff263439f12ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page