AI API Client SDK

raw JSON →
2.6.1 verified Fri May 01 auth: no python deprecated

A deprecated SDK for interacting with AI API services. The last version is 2.6.1, requiring Python >=3.9. No longer actively maintained; users should migrate to the successor library (ai-api-client).

pip install ai-api-client-sdk
error ImportError: cannot import name 'AIClient' from 'ai_api_client'
cause Using old import path without the _sdk suffix.
fix
Install the correct package or use 'from ai_api_client_sdk import AIClient'.
error ModuleNotFoundError: No module named 'ai_api_client_sdk.config'
cause Config module moved to models in version 2.0.
fix
Use 'from ai_api_client_sdk.models import AIClientConfig'.
error TypeError: __init__() got an unexpected keyword argument 'api_key'
cause Constructor signature changed in v2.6; api_key is now part of config object.
fix
Pass AIClientConfig object with api_key parameter rather than direct keyword.
deprecated This library is deprecated. Migration to ai-api-client is strongly advised.
fix Replace import from ai_api_client_sdk to ai_api_client and update method calls per migration guide.
breaking In v2.0, the package name changed: import path requires _sdk suffix.
fix Use 'from ai_api_client_sdk import ...' instead of 'from ai_api_client import ...'.
breaking AIClientConfig moved from 'config' to 'models' module in v2.0.
fix Change import to 'from ai_api_client_sdk.models import AIClientConfig'.
gotcha Default timeout is 30 seconds; long-running requests may fail silently.
fix Pass a custom timeout parameter in AIClientConfig: timeout=120.

Initialize the client with an API key and make a basic request.

import os
from ai_api_client_sdk import AIClient
from ai_api_client_sdk.models import AIClientConfig

client = AIClient(
    AIClientConfig(
        api_key=os.environ.get('AI_API_KEY', ''),
        base_url='https://api.example.com'
    )
)
response = client.generate(prompt='Hello')
print(response)