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 Common errors
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.
Warnings
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.
Imports
- AIClient wrong
from ai_api_client import AIClientcorrectfrom ai_api_client_sdk import AIClient - AIClientConfig wrong
from ai_api_client_sdk.config import AIClientConfigcorrectfrom ai_api_client_sdk.models import AIClientConfig
Quickstart
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)