Skip to main content

Advanced SDK for interacting with xAI Grok API with analytics and rate-limit handling

Project description

Rate-Limit Monitoring

The SDK provides unlimited API calls but will warn users when nearing the provider's rate limit. Example:

sdk = XaiGrokSDK(api_key="your-api-key")

# Make a request
response = sdk._request("GET", "/models")

# Check rate limit analytics
sdk.analytics()

# Example Output
# Warning: 3/100 API requests remaining. Rate limit resets at 1700000000.
# Total API calls made this session: 5


### Usage Examples

#### Retrieve Analytics
```python
sdk.analytics()
# Output:
# Total API requests: 10
# Cache hits: 2
# Retry attempts: 1

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

xai_grok_sdk_advanced-1.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

xai_grok_sdk_advanced-1.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file xai_grok_sdk_advanced-1.1.0.tar.gz.

File metadata

  • Download URL: xai_grok_sdk_advanced-1.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for xai_grok_sdk_advanced-1.1.0.tar.gz
Algorithm Hash digest
SHA256 761442bf6649469c80179ded2b71fa059295ee72b7acc585cfacd498aba0a3b4
MD5 0e4c5151b9e8d19ab1eb59f234ddf094
BLAKE2b-256 4f0f75db1e5b8dfdeccf3b331215aebdb8e6940830b7f53e34cf072843998c19

See more details on using hashes here.

File details

Details for the file xai_grok_sdk_advanced-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xai_grok_sdk_advanced-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46db7673ba3ecc369f9f1ef7973fd45d1ad56e5de30099f8208d6dc393be186b
MD5 dc1bf0b6daedd78b71efe298bd33882d
BLAKE2b-256 f3c6842bd8136339e317a90803d0ae31187ac869b26563313f2ea642db9c1ef3

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