Skip to main content

Advanced SDK for 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.3.0.tar.gz (4.7 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.3.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xai_grok_sdk_advanced-1.3.0.tar.gz
  • Upload date:
  • Size: 4.7 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.3.0.tar.gz
Algorithm Hash digest
SHA256 a93ca2d57400ba10c570686f9f624eae1c65af78e6ad41befebedae5d4910ad2
MD5 3591fb37b93235e04722dcffa8ec65fe
BLAKE2b-256 206205cd664118e844b369effc63515b9b9d23b1e0af20201e648445a32c6bba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xai_grok_sdk_advanced-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 971f02739d0035461a7a92a3f7ab759dc31f24d3ed26242d906d2887ec914b27
MD5 3c3134834d6226d263ef0dd0e45dec5c
BLAKE2b-256 90627b01160c5e901145cb00e1cd951b2e2ea7ffbf8829bdbfa525ee6b71fe59

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