Skip to content

ai& SDK

The official ai& SDKs are generated from the public OpenAPI spec and ship full type definitions. They cover the same OpenAI-compatible surface as the rest of the platform.

Terminal window
pip install aiand
import aiand
configuration = aiand.Configuration(access_token="sk-your-aiand-api-key")
client = aiand.OpenaiApi(aiand.ApiClient(configuration))
models = client.list_models()
print(models.data[0].id)
response = client.create_chat_completion(
aiand.CreateChatCompletionRequest.from_dict({
"model": "deepseek-ai/deepseek-v4-flash",
"messages": [{"role": "user", "content": "Hello"}],
})
)
print(response.choices[0].message.content)
response = client.create_response(
aiand.CreateResponseRequest(
model="deepseek-ai/deepseek-v4-flash",
input=aiand.ResponseInput("Hello"),
)
)
print(response.output[0].content[0].text)
  • list_models() / listModels()Models
  • Files, uploads, and more follow the same client — see Files