Skip to main content

Advanced SDK for xAI Grok API with direct import, 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.2.0.tar.gz (6.2 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.2.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xai_grok_sdk_advanced-1.2.0.tar.gz
  • Upload date:
  • Size: 6.2 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.2.0.tar.gz
Algorithm Hash digest
SHA256 5f01b0a7791944207b8a2da7b17fdd0eb07e5bae9a571a7f277fe0518adc54d2
MD5 720fef5350cdbd2cc1dc35a87555eb0f
BLAKE2b-256 ee258fbb019119b1d096de01d8d2baa16089294bc0d079600779294c0739875f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xai_grok_sdk_advanced-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6d91abe5aef1f89420e892ecd3d4ec56d0437034f34411d0cf2ded806ef1494
MD5 4f8ae7961fe189c4bb076ca45d593207
BLAKE2b-256 efe353e92d17060890eabe16bdebf6578311c9fb27032919d17039b5ae5b271f

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