Справочник по API Python
Создать сообщение
messages.create(**kwargs) -> MessageОтправьте структурированный список входных сообщений с текстом и/или изображениями, и модель сгенерирует следующее сообщение в разговоре.
Подсчитать токены в сообщении
messages.count_tokens(**kwargs) -> MessageTokensCountПодсчитайте количество токенов в сообщении.
Список моделей
models.list(**kwargs) -> SyncPage[ModelInfo]Получите список доступных моделей.
Получить модель
models.retrieve(model_id, **kwargs) -> ModelInfoПолучите конкретную модель.
Скачать файл
files.download(file_id, **kwargs) -> BinaryResponseContentПолучить метаданные файла
files.retrieve_metadata(file_id, **kwargs) -> FileMetadataПрофили пользователей
Register the end customers that your platform serves, so each request can name who it's for. To get started, see the User profiles guide.
Создать профиль пользователя
user_profiles.create(**kwargs) -> UserProfileRegister one of your end customers and get the ID to send on the requests you make for them.
Список профилей пользователей
user_profiles.list(**kwargs) -> SyncPageCursor[UserProfile]List the user profiles in your organization, newest first by default.
Получить профиль пользователя
user_profiles.retrieve(user_profile_id, **kwargs) -> UserProfileGet a user profile by ID to check the details stored for it.
Обновить профиль пользователя
user_profiles.update(user_profile_id, **kwargs) -> UserProfileChange the details of a user profile, leaving the fields that you don't send as they are.
Удалить профиль пользователя
user_profiles.delete(user_profile_id, **kwargs) -> DeletedUserProfileDelete a user profile, for example when the end customer closes their account.
Получить текущую организацию
organization.retrieve() -> OrganizationInfoВозвращает информацию об организации, связанной с аутентифицированным ключом API.