The OpenAI API: build it with make.
Attributes#
| Attribute | Type | Description |
|---|---|---|
error_class | = OpenAiClientError | |
transform_streams | = True |
Functions#
__init__#
__init__(http_client, transform_client=None) -> None| Parameter | Type | Description |
|---|---|---|
http_client | HttpClientService[HttpClientError] | |
transform_client | ClientTransform | None = None |
def __init__(
self,
http_client: HttpClientService[HttpClientError],
transform_client: ClientTransform | None = None,
) -> None:
self.http_client = http_client
self._transform = transform_clientlist_assistants#
list_assistants(*, params: _T.ListAssistantsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAssistants200, _Errors]
list_assistants(*, params: _T.ListAssistantsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAssistants200, _HttpClientResponse], _Errors]Returns a list of assistants.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_assistants(self, *, params: _T.ListAssistantsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAssistants200, _Errors]: ...
@_t.overload
def list_assistants(self, *, params: _T.ListAssistantsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAssistants200, _HttpClientResponse], _Errors]: ...
def list_assistants(self, *, params: _T.ListAssistantsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of assistants."""
return self._json(_LIST_ASSISTANTS, "/assistants", params, None, include_response)create_assistant#
create_assistant(*, payload: _T.CreateAssistantRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAssistant200, _Errors]
create_assistant(*, payload: _T.CreateAssistantRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAssistant200, _HttpClientResponse], _Errors]Create an assistant with a model and instructions.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_assistant(self, *, payload: _T.CreateAssistantRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAssistant200, _Errors]: ...
@_t.overload
def create_assistant(self, *, payload: _T.CreateAssistantRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAssistant200, _HttpClientResponse], _Errors]: ...
def create_assistant(self, *, payload: _T.CreateAssistantRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create an assistant with a model and instructions."""
return self._json(_CREATE_ASSISTANT, "/assistants", None, _c.json_body(payload), include_response)get_assistant#
get_assistant(assistant_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetAssistant200, _Errors]
get_assistant(assistant_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetAssistant200, _HttpClientResponse], _Errors]Retrieves an assistant.
| Parameter | Type | Description |
|---|---|---|
assistant_id | ||
include_response | = False |
@_t.overload
def get_assistant(self, assistant_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetAssistant200, _Errors]: ...
@_t.overload
def get_assistant(self, assistant_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetAssistant200, _HttpClientResponse], _Errors]: ...
def get_assistant(self, assistant_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves an assistant."""
return self._json(_GET_ASSISTANT, _c.encoded_path("/assistants/{}", assistant_id), None, None, include_response)modify_assistant#
modify_assistant(assistant_id: str, *, payload: _T.ModifyAssistantRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyAssistant200, _Errors]
modify_assistant(assistant_id: str, *, payload: _T.ModifyAssistantRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyAssistant200, _HttpClientResponse], _Errors]Modifies an assistant.
| Parameter | Type | Description |
|---|---|---|
assistant_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_assistant(self, assistant_id: str, *, payload: _T.ModifyAssistantRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyAssistant200, _Errors]: ...
@_t.overload
def modify_assistant(self, assistant_id: str, *, payload: _T.ModifyAssistantRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyAssistant200, _HttpClientResponse], _Errors]: ...
def modify_assistant(self, assistant_id: str, *, payload: _T.ModifyAssistantRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modifies an assistant."""
return self._json(_MODIFY_ASSISTANT, _c.encoded_path("/assistants/{}", assistant_id), None, _c.json_body(payload), include_response)delete_assistant#
delete_assistant(assistant_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAssistant200, _Errors]
delete_assistant(assistant_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAssistant200, _HttpClientResponse], _Errors]Delete an assistant.
| Parameter | Type | Description |
|---|---|---|
assistant_id | ||
include_response | = False |
@_t.overload
def delete_assistant(self, assistant_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAssistant200, _Errors]: ...
@_t.overload
def delete_assistant(self, assistant_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAssistant200, _HttpClientResponse], _Errors]: ...
def delete_assistant(self, assistant_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete an assistant."""
return self._json(_DELETE_ASSISTANT, _c.encoded_path("/assistants/{}", assistant_id), None, None, include_response)create_speech#
create_speech(*, payload: _T.CreateSpeechRequestJson, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]
create_speech(*, payload: _T.CreateSpeechRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]Generates audio from the input text.
Returns the audio file content, or a stream of audio events.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_speech(self, *, payload: _T.CreateSpeechRequestJson, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]: ...
@_t.overload
def create_speech(self, *, payload: _T.CreateSpeechRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]: ...
def create_speech(self, *, payload: _T.CreateSpeechRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Generates audio from the input text.
Returns the audio file content, or a stream of audio events."""
return self._json(_CREATE_SPEECH, "/audio/speech", None, _c.json_body(payload), include_response)create_speech_sse#
create_speech_sse(*, payload) -> _Stream[_sse.DataEvent[_T.CreateSpeech200Sse], _SseErrors]Generates audio from the input text.
Returns the audio file content, or a stream of audio events.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateSpeechRequestJson |
Returns _Stream[_sse.DataEvent[_T.CreateSpeech200Sse], _SseErrors]
def create_speech_sse(self, *, payload: _T.CreateSpeechRequestJson) -> _Stream[_sse.DataEvent[_T.CreateSpeech200Sse], _SseErrors]:
"""Generates audio from the input text.
Returns the audio file content, or a stream of audio events."""
return self._sse(_CREATE_SPEECH_SSE, "/audio/speech", None, _c.json_body(payload), CreateSpeech200Sse)create_speech_stream#
create_speech_stream(*, payload) -> _Stream[bytes, _HttpClientError]Generates audio from the input text.
Returns the audio file content, or a stream of audio events.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateSpeechRequestJson |
Returns _Stream[bytes, _HttpClientError]
def create_speech_stream(self, *, payload: _T.CreateSpeechRequestJson) -> _Stream[bytes, _HttpClientError]:
"""Generates audio from the input text.
Returns the audio file content, or a stream of audio events."""
return self._binary(_CREATE_SPEECH_STREAM, "/audio/speech", None, _c.json_body(payload))create_transcription#
create_transcription(*, payload: _T.CreateTranscriptionRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateTranscription200, _Errors]
create_transcription(*, payload: _T.CreateTranscriptionRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateTranscription200, _HttpClientResponse], _Errors]Transcribes audio into the input language.
Returns a transcription object in json, diarized_json, or verbose_json
format, plain text in text, srt, or vtt format, or a stream of
transcript events. Supported formats depend on the model.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_transcription(self, *, payload: _T.CreateTranscriptionRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateTranscription200, _Errors]: ...
@_t.overload
def create_transcription(self, *, payload: _T.CreateTranscriptionRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateTranscription200, _HttpClientResponse], _Errors]: ...
def create_transcription(self, *, payload: _T.CreateTranscriptionRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Transcribes audio into the input language.
Returns a transcription object in `json`, `diarized_json`, or `verbose_json`
format, plain text in `text`, `srt`, or `vtt` format, or a stream of
transcript events. Supported formats depend on the model."""
return self._json(_CREATE_TRANSCRIPTION, "/audio/transcriptions", None, _c.form_body(payload), include_response)create_transcription_sse#
create_transcription_sse(*, payload) -> _Stream[_sse.DataEvent[_T.CreateTranscription200Sse], _SseErrors]Transcribes audio into the input language.
Returns a transcription object in json, diarized_json, or verbose_json
format, plain text in text, srt, or vtt format, or a stream of
transcript events. Supported formats depend on the model.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateTranscriptionRequestFormData |
Returns _Stream[_sse.DataEvent[_T.CreateTranscription200Sse], _SseErrors]
def create_transcription_sse(self, *, payload: _T.CreateTranscriptionRequestFormData) -> _Stream[_sse.DataEvent[_T.CreateTranscription200Sse], _SseErrors]:
"""Transcribes audio into the input language.
Returns a transcription object in `json`, `diarized_json`, or `verbose_json`
format, plain text in `text`, `srt`, or `vtt` format, or a stream of
transcript events. Supported formats depend on the model."""
return self._sse(_CREATE_TRANSCRIPTION_SSE, "/audio/transcriptions", None, _c.form_body(payload), CreateTranscription200Sse)create_translation#
create_translation(*, payload: _T.CreateTranslationRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateTranslation200, _Errors]
create_translation(*, payload: _T.CreateTranslationRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateTranslation200, _HttpClientResponse], _Errors]Translates audio into English.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_translation(self, *, payload: _T.CreateTranslationRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateTranslation200, _Errors]: ...
@_t.overload
def create_translation(self, *, payload: _T.CreateTranslationRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateTranslation200, _HttpClientResponse], _Errors]: ...
def create_translation(self, *, payload: _T.CreateTranslationRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Translates audio into English."""
return self._json(_CREATE_TRANSLATION, "/audio/translations", None, _c.form_body(payload), include_response)list_voice_consents#
list_voice_consents(*, params: _T.ListVoiceConsentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVoiceConsents200, _Errors]
list_voice_consents(*, params: _T.ListVoiceConsentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVoiceConsents200, _HttpClientResponse], _Errors]Returns a list of voice consent recordings.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_voice_consents(self, *, params: _T.ListVoiceConsentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVoiceConsents200, _Errors]: ...
@_t.overload
def list_voice_consents(self, *, params: _T.ListVoiceConsentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVoiceConsents200, _HttpClientResponse], _Errors]: ...
def list_voice_consents(self, *, params: _T.ListVoiceConsentsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of voice consent recordings."""
return self._json(_LIST_VOICE_CONSENTS, "/audio/voice_consents", params, None, include_response)create_voice_consent#
create_voice_consent(*, payload: _T.CreateVoiceConsentRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVoiceConsent200, _Errors]
create_voice_consent(*, payload: _T.CreateVoiceConsentRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVoiceConsent200, _HttpClientResponse], _Errors]Upload a voice consent recording.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_voice_consent(self, *, payload: _T.CreateVoiceConsentRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVoiceConsent200, _Errors]: ...
@_t.overload
def create_voice_consent(self, *, payload: _T.CreateVoiceConsentRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVoiceConsent200, _HttpClientResponse], _Errors]: ...
def create_voice_consent(self, *, payload: _T.CreateVoiceConsentRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Upload a voice consent recording."""
return self._json(_CREATE_VOICE_CONSENT, "/audio/voice_consents", None, _c.form_body(payload), include_response)get_voice_consent#
get_voice_consent(consent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVoiceConsent200, _Errors]
get_voice_consent(consent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVoiceConsent200, _HttpClientResponse], _Errors]Retrieves a voice consent recording.
| Parameter | Type | Description |
|---|---|---|
consent_id | ||
include_response | = False |
@_t.overload
def get_voice_consent(self, consent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVoiceConsent200, _Errors]: ...
@_t.overload
def get_voice_consent(self, consent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVoiceConsent200, _HttpClientResponse], _Errors]: ...
def get_voice_consent(self, consent_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a voice consent recording."""
return self._json(_GET_VOICE_CONSENT, _c.encoded_path("/audio/voice_consents/{}", consent_id), None, None, include_response)update_voice_consent#
update_voice_consent(consent_id: str, *, payload: _T.UpdateVoiceConsentRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateVoiceConsent200, _Errors]
update_voice_consent(consent_id: str, *, payload: _T.UpdateVoiceConsentRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateVoiceConsent200, _HttpClientResponse], _Errors]Updates a voice consent recording (metadata only).
| Parameter | Type | Description |
|---|---|---|
consent_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_voice_consent(self, consent_id: str, *, payload: _T.UpdateVoiceConsentRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateVoiceConsent200, _Errors]: ...
@_t.overload
def update_voice_consent(self, consent_id: str, *, payload: _T.UpdateVoiceConsentRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateVoiceConsent200, _HttpClientResponse], _Errors]: ...
def update_voice_consent(self, consent_id: str, *, payload: _T.UpdateVoiceConsentRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates a voice consent recording (metadata only)."""
return self._json(_UPDATE_VOICE_CONSENT, _c.encoded_path("/audio/voice_consents/{}", consent_id), None, _c.json_body(payload), include_response)delete_voice_consent#
delete_voice_consent(consent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVoiceConsent200, _Errors]
delete_voice_consent(consent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVoiceConsent200, _HttpClientResponse], _Errors]Deletes a voice consent recording.
| Parameter | Type | Description |
|---|---|---|
consent_id | ||
include_response | = False |
@_t.overload
def delete_voice_consent(self, consent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVoiceConsent200, _Errors]: ...
@_t.overload
def delete_voice_consent(self, consent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVoiceConsent200, _HttpClientResponse], _Errors]: ...
def delete_voice_consent(self, consent_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a voice consent recording."""
return self._json(_DELETE_VOICE_CONSENT, _c.encoded_path("/audio/voice_consents/{}", consent_id), None, None, include_response)create_voice#
create_voice(*, payload: _T.CreateVoiceRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVoice200, _Errors]
create_voice(*, payload: _T.CreateVoiceRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVoice200, _HttpClientResponse], _Errors]Create a custom voice you can use for audio output (for example, in Text-to-Speech and the Realtime API). This requires an audio sample and a previously uploaded consent recording.
Send name, audio_sample, and the consent recording ID as multipart form data. The optional type defaults to audio_sample.
Returns the saved voice's metadata. See the custom voices guide for requirements and best practices. Custom voices are limited to eligible customers.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_voice(self, *, payload: _T.CreateVoiceRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVoice200, _Errors]: ...
@_t.overload
def create_voice(self, *, payload: _T.CreateVoiceRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVoice200, _HttpClientResponse], _Errors]: ...
def create_voice(self, *, payload: _T.CreateVoiceRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a custom voice you can use for audio output (for example, in Text-to-Speech and the Realtime API). This requires an audio sample and a previously uploaded consent recording.
Send `name`, `audio_sample`, and the `consent` recording ID as multipart form data. The optional `type` defaults to `audio_sample`.
Returns the saved voice's metadata. See the [custom voices guide](https://developers.openai.com/api/docs/guides/text-to-speech#custom-voices) for requirements and best practices. Custom voices are limited to eligible customers."""
return self._json(_CREATE_VOICE, "/audio/voices", None, _c.form_body(payload), include_response)list_batches#
list_batches(*, params: _T.ListBatchesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListBatches200, _Errors]
list_batches(*, params: _T.ListBatchesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListBatches200, _HttpClientResponse], _Errors]List your organization's batches.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_batches(self, *, params: _T.ListBatchesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListBatches200, _Errors]: ...
@_t.overload
def list_batches(self, *, params: _T.ListBatchesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListBatches200, _HttpClientResponse], _Errors]: ...
def list_batches(self, *, params: _T.ListBatchesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List your organization's batches."""
return self._json(_LIST_BATCHES, "/batches", params, None, include_response)create_batch#
create_batch(*, payload: _T.CreateBatchRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateBatch200, _Errors]
create_batch(*, payload: _T.CreateBatchRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateBatch200, _HttpClientResponse], _Errors]Creates and executes a batch from an uploaded file of requests
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_batch(self, *, payload: _T.CreateBatchRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateBatch200, _Errors]: ...
@_t.overload
def create_batch(self, *, payload: _T.CreateBatchRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateBatch200, _HttpClientResponse], _Errors]: ...
def create_batch(self, *, payload: _T.CreateBatchRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates and executes a batch from an uploaded file of requests"""
return self._json(_CREATE_BATCH, "/batches", None, _c.json_body(payload), include_response)retrieve_batch#
retrieve_batch(batch_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveBatch200, _Errors]
retrieve_batch(batch_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveBatch200, _HttpClientResponse], _Errors]Retrieves a batch.
| Parameter | Type | Description |
|---|---|---|
batch_id | ||
include_response | = False |
@_t.overload
def retrieve_batch(self, batch_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveBatch200, _Errors]: ...
@_t.overload
def retrieve_batch(self, batch_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveBatch200, _HttpClientResponse], _Errors]: ...
def retrieve_batch(self, batch_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a batch."""
return self._json(_RETRIEVE_BATCH, _c.encoded_path("/batches/{}", batch_id), None, None, include_response)cancel_batch#
cancel_batch(batch_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelBatch200, _Errors]
cancel_batch(batch_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelBatch200, _HttpClientResponse], _Errors]Cancels an in-progress batch. The batch will be in status cancelling for up to 10 minutes, before changing to cancelled, where it will have partial results (if any) available in the output file.
| Parameter | Type | Description |
|---|---|---|
batch_id | ||
include_response | = False |
@_t.overload
def cancel_batch(self, batch_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelBatch200, _Errors]: ...
@_t.overload
def cancel_batch(self, batch_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelBatch200, _HttpClientResponse], _Errors]: ...
def cancel_batch(self, batch_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes, before changing to `cancelled`, where it will have partial results (if any) available in the output file."""
return self._json(_CANCEL_BATCH, _c.encoded_path("/batches/{}/cancel", batch_id), None, None, include_response)list_chat_completions#
list_chat_completions(*, params: _T.ListChatCompletionsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListChatCompletions200, _Errors]
list_chat_completions(*, params: _T.ListChatCompletionsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListChatCompletions200, _HttpClientResponse], _Errors]List stored Chat Completions. Only Chat Completions that have been stored
with the store parameter set to true will be returned.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_chat_completions(self, *, params: _T.ListChatCompletionsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListChatCompletions200, _Errors]: ...
@_t.overload
def list_chat_completions(self, *, params: _T.ListChatCompletionsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListChatCompletions200, _HttpClientResponse], _Errors]: ...
def list_chat_completions(self, *, params: _T.ListChatCompletionsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List stored Chat Completions. Only Chat Completions that have been stored
with the `store` parameter set to `true` will be returned."""
return self._json(_LIST_CHAT_COMPLETIONS, "/chat/completions", params, None, include_response)create_chat_completion#
create_chat_completion(*, payload: _T.CreateChatCompletionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateChatCompletion200, _Errors]
create_chat_completion(*, payload: _T.CreateChatCompletionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateChatCompletion200, _HttpClientResponse], _Errors]Starting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses.
Creates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides.
Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, refer to the reasoning guide.
Returns a chat completion object, or a streamed sequence of chat completion chunk objects if the request is streamed.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_chat_completion(self, *, payload: _T.CreateChatCompletionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateChatCompletion200, _Errors]: ...
@_t.overload
def create_chat_completion(self, *, payload: _T.CreateChatCompletionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateChatCompletion200, _HttpClientResponse], _Errors]: ...
def create_chat_completion(self, *, payload: _T.CreateChatCompletionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""**Starting a new project?** We recommend trying [Responses](https://developers.openai.com/api/reference/resources/responses)
to take advantage of the latest OpenAI platform features. Compare
[Chat Completions with Responses](https://developers.openai.com/api/docs/guides/migrate-to-responses?api-mode=responses).
---
Creates a model response for the given chat conversation. Learn more in the
[text generation](https://developers.openai.com/api/docs/guides/text), [vision](https://developers.openai.com/api/docs/guides/images-vision),
and [audio](https://developers.openai.com/api/docs/guides/audio) guides.
Parameter support can differ depending on the model used to generate the
response, particularly for newer reasoning models. Parameters that are only
supported for reasoning models are noted below. For the current state of
unsupported parameters in reasoning models,
[refer to the reasoning guide](https://developers.openai.com/api/docs/guides/reasoning).
Returns a chat completion object, or a streamed sequence of chat completion
chunk objects if the request is streamed."""
return self._json(_CREATE_CHAT_COMPLETION, "/chat/completions", None, _c.json_body(payload), include_response)create_chat_completion_sse#
create_chat_completion_sse(*, payload) -> _Stream[_sse.DataEvent[_T.CreateChatCompletion200Sse], _SseErrors]Starting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses.
Creates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides.
Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, refer to the reasoning guide.
Returns a chat completion object, or a streamed sequence of chat completion chunk objects if the request is streamed.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateChatCompletionRequestJson |
Returns _Stream[_sse.DataEvent[_T.CreateChatCompletion200Sse], _SseErrors]
def create_chat_completion_sse(self, *, payload: _T.CreateChatCompletionRequestJson) -> _Stream[_sse.DataEvent[_T.CreateChatCompletion200Sse], _SseErrors]:
"""**Starting a new project?** We recommend trying [Responses](https://developers.openai.com/api/reference/resources/responses)
to take advantage of the latest OpenAI platform features. Compare
[Chat Completions with Responses](https://developers.openai.com/api/docs/guides/migrate-to-responses?api-mode=responses).
---
Creates a model response for the given chat conversation. Learn more in the
[text generation](https://developers.openai.com/api/docs/guides/text), [vision](https://developers.openai.com/api/docs/guides/images-vision),
and [audio](https://developers.openai.com/api/docs/guides/audio) guides.
Parameter support can differ depending on the model used to generate the
response, particularly for newer reasoning models. Parameters that are only
supported for reasoning models are noted below. For the current state of
unsupported parameters in reasoning models,
[refer to the reasoning guide](https://developers.openai.com/api/docs/guides/reasoning).
Returns a chat completion object, or a streamed sequence of chat completion
chunk objects if the request is streamed."""
return self._sse(_CREATE_CHAT_COMPLETION_SSE, "/chat/completions", None, _c.json_body(payload), CreateChatCompletion200Sse)get_chat_completion#
get_chat_completion(completion_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetChatCompletion200, _Errors]
get_chat_completion(completion_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetChatCompletion200, _HttpClientResponse], _Errors]Get a stored chat completion. Only Chat Completions that have been created
with the store parameter set to true will be returned.
| Parameter | Type | Description |
|---|---|---|
completion_id | ||
include_response | = False |
@_t.overload
def get_chat_completion(self, completion_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetChatCompletion200, _Errors]: ...
@_t.overload
def get_chat_completion(self, completion_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetChatCompletion200, _HttpClientResponse], _Errors]: ...
def get_chat_completion(self, completion_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a stored chat completion. Only Chat Completions that have been created
with the `store` parameter set to `true` will be returned."""
return self._json(_GET_CHAT_COMPLETION, _c.encoded_path("/chat/completions/{}", completion_id), None, None, include_response)update_chat_completion#
update_chat_completion(completion_id: str, *, payload: _T.UpdateChatCompletionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateChatCompletion200, _Errors]
update_chat_completion(completion_id: str, *, payload: _T.UpdateChatCompletionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateChatCompletion200, _HttpClientResponse], _Errors]Modify a stored chat completion. Only Chat Completions that have been
created with the store parameter set to true can be modified. Currently,
the only supported modification is to update the metadata field.
| Parameter | Type | Description |
|---|---|---|
completion_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_chat_completion(self, completion_id: str, *, payload: _T.UpdateChatCompletionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateChatCompletion200, _Errors]: ...
@_t.overload
def update_chat_completion(self, completion_id: str, *, payload: _T.UpdateChatCompletionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateChatCompletion200, _HttpClientResponse], _Errors]: ...
def update_chat_completion(self, completion_id: str, *, payload: _T.UpdateChatCompletionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modify a stored chat completion. Only Chat Completions that have been
created with the `store` parameter set to `true` can be modified. Currently,
the only supported modification is to update the `metadata` field."""
return self._json(_UPDATE_CHAT_COMPLETION, _c.encoded_path("/chat/completions/{}", completion_id), None, _c.json_body(payload), include_response)delete_chat_completion#
delete_chat_completion(completion_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteChatCompletion200, _Errors]
delete_chat_completion(completion_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteChatCompletion200, _HttpClientResponse], _Errors]Delete a stored chat completion. Only Chat Completions that have been
created with the store parameter set to true can be deleted.
| Parameter | Type | Description |
|---|---|---|
completion_id | ||
include_response | = False |
@_t.overload
def delete_chat_completion(self, completion_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteChatCompletion200, _Errors]: ...
@_t.overload
def delete_chat_completion(self, completion_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteChatCompletion200, _HttpClientResponse], _Errors]: ...
def delete_chat_completion(self, completion_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a stored chat completion. Only Chat Completions that have been
created with the `store` parameter set to `true` can be deleted."""
return self._json(_DELETE_CHAT_COMPLETION, _c.encoded_path("/chat/completions/{}", completion_id), None, None, include_response)get_chat_completion_messages#
get_chat_completion_messages(completion_id: str, *, params: _T.GetChatCompletionMessagesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetChatCompletionMessages200, _Errors]
get_chat_completion_messages(completion_id: str, *, params: _T.GetChatCompletionMessagesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetChatCompletionMessages200, _HttpClientResponse], _Errors]Get the messages in a stored chat completion. Only Chat Completions that
have been created with the store parameter set to true will be
returned.
| Parameter | Type | Description |
|---|---|---|
completion_id | ||
params | = None | |
include_response | = False |
@_t.overload
def get_chat_completion_messages(self, completion_id: str, *, params: _T.GetChatCompletionMessagesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetChatCompletionMessages200, _Errors]: ...
@_t.overload
def get_chat_completion_messages(self, completion_id: str, *, params: _T.GetChatCompletionMessagesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetChatCompletionMessages200, _HttpClientResponse], _Errors]: ...
def get_chat_completion_messages(self, completion_id: str, *, params: _T.GetChatCompletionMessagesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get the messages in a stored chat completion. Only Chat Completions that
have been created with the `store` parameter set to `true` will be
returned."""
return self._json(_GET_CHAT_COMPLETION_MESSAGES, _c.encoded_path("/chat/completions/{}/messages", completion_id), params, None, include_response)create_completion#
create_completion(*, payload: _T.CreateCompletionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateCompletion200, _Errors]
create_completion(*, payload: _T.CreateCompletionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateCompletion200, _HttpClientResponse], _Errors]Creates a completion for the provided prompt and parameters.
Returns a completion object, or a sequence of completion objects if the request is streamed.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_completion(self, *, payload: _T.CreateCompletionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateCompletion200, _Errors]: ...
@_t.overload
def create_completion(self, *, payload: _T.CreateCompletionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateCompletion200, _HttpClientResponse], _Errors]: ...
def create_completion(self, *, payload: _T.CreateCompletionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a completion for the provided prompt and parameters.
Returns a completion object, or a sequence of completion objects if the request is streamed."""
return self._json(_CREATE_COMPLETION, "/completions", None, _c.json_body(payload), include_response)list_containers#
list_containers(*, params: _T.ListContainersParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListContainers200, _Errors]
list_containers(*, params: _T.ListContainersParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListContainers200, _HttpClientResponse], _Errors]List Containers
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_containers(self, *, params: _T.ListContainersParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListContainers200, _Errors]: ...
@_t.overload
def list_containers(self, *, params: _T.ListContainersParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListContainers200, _HttpClientResponse], _Errors]: ...
def list_containers(self, *, params: _T.ListContainersParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List Containers"""
return self._json(_LIST_CONTAINERS, "/containers", params, None, include_response)create_container#
create_container(*, payload: _T.CreateContainerRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateContainer200, _Errors]
create_container(*, payload: _T.CreateContainerRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateContainer200, _HttpClientResponse], _Errors]Create Container
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_container(self, *, payload: _T.CreateContainerRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateContainer200, _Errors]: ...
@_t.overload
def create_container(self, *, payload: _T.CreateContainerRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateContainer200, _HttpClientResponse], _Errors]: ...
def create_container(self, *, payload: _T.CreateContainerRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create Container"""
return self._json(_CREATE_CONTAINER, "/containers", None, _c.json_body(payload), include_response)retrieve_container#
retrieve_container(container_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveContainer200, _Errors]
retrieve_container(container_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveContainer200, _HttpClientResponse], _Errors]Retrieve Container
| Parameter | Type | Description |
|---|---|---|
container_id | ||
include_response | = False |
@_t.overload
def retrieve_container(self, container_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveContainer200, _Errors]: ...
@_t.overload
def retrieve_container(self, container_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveContainer200, _HttpClientResponse], _Errors]: ...
def retrieve_container(self, container_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieve Container"""
return self._json(_RETRIEVE_CONTAINER, _c.encoded_path("/containers/{}", container_id), None, None, include_response)delete_container#
delete_container(container_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteContainer200, _Errors]
delete_container(container_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteContainer200, _HttpClientResponse], _Errors]Delete Container
| Parameter | Type | Description |
|---|---|---|
container_id | ||
include_response | = False |
@_t.overload
def delete_container(self, container_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteContainer200, _Errors]: ...
@_t.overload
def delete_container(self, container_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteContainer200, _HttpClientResponse], _Errors]: ...
def delete_container(self, container_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete Container"""
return self._json(_DELETE_CONTAINER, _c.encoded_path("/containers/{}", container_id), None, None, include_response)list_container_files#
list_container_files(container_id: str, *, params: _T.ListContainerFilesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListContainerFiles200, _Errors]
list_container_files(container_id: str, *, params: _T.ListContainerFilesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListContainerFiles200, _HttpClientResponse], _Errors]List Container files
| Parameter | Type | Description |
|---|---|---|
container_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_container_files(self, container_id: str, *, params: _T.ListContainerFilesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListContainerFiles200, _Errors]: ...
@_t.overload
def list_container_files(self, container_id: str, *, params: _T.ListContainerFilesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListContainerFiles200, _HttpClientResponse], _Errors]: ...
def list_container_files(self, container_id: str, *, params: _T.ListContainerFilesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List Container files"""
return self._json(_LIST_CONTAINER_FILES, _c.encoded_path("/containers/{}/files", container_id), params, None, include_response)create_container_file#
create_container_file(container_id: str, *, payload: _T.CreateContainerFileRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateContainerFile200, _Errors]
create_container_file(container_id: str, *, payload: _T.CreateContainerFileRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateContainerFile200, _HttpClientResponse], _Errors]Create a Container File
You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.
| Parameter | Type | Description |
|---|---|---|
container_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_container_file(self, container_id: str, *, payload: _T.CreateContainerFileRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateContainerFile200, _Errors]: ...
@_t.overload
def create_container_file(self, container_id: str, *, payload: _T.CreateContainerFileRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateContainerFile200, _HttpClientResponse], _Errors]: ...
def create_container_file(self, container_id: str, *, payload: _T.CreateContainerFileRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a Container File
You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID."""
return self._json(_CREATE_CONTAINER_FILE, _c.encoded_path("/containers/{}/files", container_id), None, _c.form_body(payload), include_response)retrieve_container_file#
retrieve_container_file(container_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveContainerFile200, _Errors]
retrieve_container_file(container_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveContainerFile200, _HttpClientResponse], _Errors]Retrieve Container File
| Parameter | Type | Description |
|---|---|---|
container_id | ||
file_id | ||
include_response | = False |
@_t.overload
def retrieve_container_file(self, container_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveContainerFile200, _Errors]: ...
@_t.overload
def retrieve_container_file(self, container_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveContainerFile200, _HttpClientResponse], _Errors]: ...
def retrieve_container_file(self, container_id: str, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieve Container File"""
return self._json(_RETRIEVE_CONTAINER_FILE, _c.encoded_path("/containers/{}/files/{}", container_id, file_id), None, None, include_response)delete_container_file#
delete_container_file(container_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteContainerFile200, _Errors]
delete_container_file(container_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteContainerFile200, _HttpClientResponse], _Errors]Delete Container File
| Parameter | Type | Description |
|---|---|---|
container_id | ||
file_id | ||
include_response | = False |
@_t.overload
def delete_container_file(self, container_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteContainerFile200, _Errors]: ...
@_t.overload
def delete_container_file(self, container_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteContainerFile200, _HttpClientResponse], _Errors]: ...
def delete_container_file(self, container_id: str, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete Container File"""
return self._json(_DELETE_CONTAINER_FILE, _c.encoded_path("/containers/{}/files/{}", container_id, file_id), None, None, include_response)retrieve_container_file_content#
retrieve_container_file_content(container_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]
retrieve_container_file_content(container_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]Retrieve Container File Content
| Parameter | Type | Description |
|---|---|---|
container_id | ||
file_id | ||
include_response | = False |
@_t.overload
def retrieve_container_file_content(self, container_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]: ...
@_t.overload
def retrieve_container_file_content(self, container_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]: ...
def retrieve_container_file_content(self, container_id: str, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieve Container File Content"""
return self._json(_RETRIEVE_CONTAINER_FILE_CONTENT, _c.encoded_path("/containers/{}/files/{}/content", container_id, file_id), None, None, include_response)retrieve_container_file_content_stream#
retrieve_container_file_content_stream(container_id, file_id) -> _Stream[bytes, _HttpClientError]Retrieve Container File Content
| Parameter | Type | Description |
|---|---|---|
container_id | str | |
file_id | str |
Returns _Stream[bytes, _HttpClientError]
def retrieve_container_file_content_stream(self, container_id: str, file_id: str) -> _Stream[bytes, _HttpClientError]:
"""Retrieve Container File Content"""
return self._binary(_RETRIEVE_CONTAINER_FILE_CONTENT_STREAM, _c.encoded_path("/containers/{}/files/{}/content", container_id, file_id), None, None)list_conversation_items#
list_conversation_items(conversation_id: str, *, params: _T.ListConversationItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListConversationItems200, _Errors]
list_conversation_items(conversation_id: str, *, params: _T.ListConversationItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListConversationItems200, _HttpClientResponse], _Errors]List all items for a conversation with the given ID.
| Parameter | Type | Description |
|---|---|---|
conversation_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_conversation_items(self, conversation_id: str, *, params: _T.ListConversationItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListConversationItems200, _Errors]: ...
@_t.overload
def list_conversation_items(self, conversation_id: str, *, params: _T.ListConversationItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListConversationItems200, _HttpClientResponse], _Errors]: ...
def list_conversation_items(self, conversation_id: str, *, params: _T.ListConversationItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List all items for a conversation with the given ID."""
return self._json(_LIST_CONVERSATION_ITEMS, _c.encoded_path("/conversations/{}/items", conversation_id), params, None, include_response)create_conversation_items#
create_conversation_items(conversation_id: str, *, payload: _T.CreateConversationItemsRequestJson, params: _T.CreateConversationItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateConversationItems200, _Errors]
create_conversation_items(conversation_id: str, *, payload: _T.CreateConversationItemsRequestJson, params: _T.CreateConversationItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateConversationItems200, _HttpClientResponse], _Errors]Create items in a conversation with the given ID.
| Parameter | Type | Description |
|---|---|---|
conversation_id | ||
payload | ||
params | = None | |
include_response | = False |
@_t.overload
def create_conversation_items(self, conversation_id: str, *, payload: _T.CreateConversationItemsRequestJson, params: _T.CreateConversationItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateConversationItems200, _Errors]: ...
@_t.overload
def create_conversation_items(self, conversation_id: str, *, payload: _T.CreateConversationItemsRequestJson, params: _T.CreateConversationItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateConversationItems200, _HttpClientResponse], _Errors]: ...
def create_conversation_items(self, conversation_id: str, *, payload: _T.CreateConversationItemsRequestJson, params: _T.CreateConversationItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create items in a conversation with the given ID."""
return self._json(_CREATE_CONVERSATION_ITEMS, _c.encoded_path("/conversations/{}/items", conversation_id), params, _c.json_body(payload), include_response)get_conversation_item#
get_conversation_item(conversation_id: str, item_id: str, *, params: _T.GetConversationItemParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetConversationItem200, _Errors]
get_conversation_item(conversation_id: str, item_id: str, *, params: _T.GetConversationItemParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetConversationItem200, _HttpClientResponse], _Errors]Get a single item from a conversation with the given IDs.
| Parameter | Type | Description |
|---|---|---|
conversation_id | ||
item_id | ||
params | = None | |
include_response | = False |
@_t.overload
def get_conversation_item(self, conversation_id: str, item_id: str, *, params: _T.GetConversationItemParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetConversationItem200, _Errors]: ...
@_t.overload
def get_conversation_item(self, conversation_id: str, item_id: str, *, params: _T.GetConversationItemParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetConversationItem200, _HttpClientResponse], _Errors]: ...
def get_conversation_item(self, conversation_id: str, item_id: str, *, params: _T.GetConversationItemParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a single item from a conversation with the given IDs."""
return self._json(_GET_CONVERSATION_ITEM, _c.encoded_path("/conversations/{}/items/{}", conversation_id, item_id), params, None, include_response)delete_conversation_item#
delete_conversation_item(conversation_id: str, item_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteConversationItem200, _Errors]
delete_conversation_item(conversation_id: str, item_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteConversationItem200, _HttpClientResponse], _Errors]Delete an item from a conversation with the given IDs.
| Parameter | Type | Description |
|---|---|---|
conversation_id | ||
item_id | ||
include_response | = False |
@_t.overload
def delete_conversation_item(self, conversation_id: str, item_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteConversationItem200, _Errors]: ...
@_t.overload
def delete_conversation_item(self, conversation_id: str, item_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteConversationItem200, _HttpClientResponse], _Errors]: ...
def delete_conversation_item(self, conversation_id: str, item_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete an item from a conversation with the given IDs."""
return self._json(_DELETE_CONVERSATION_ITEM, _c.encoded_path("/conversations/{}/items/{}", conversation_id, item_id), None, None, include_response)create_embedding#
create_embedding(*, payload: _T.CreateEmbeddingRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateEmbedding200, _Errors]
create_embedding(*, payload: _T.CreateEmbeddingRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateEmbedding200, _HttpClientResponse], _Errors]Creates an embedding vector representing the input text.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_embedding(self, *, payload: _T.CreateEmbeddingRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateEmbedding200, _Errors]: ...
@_t.overload
def create_embedding(self, *, payload: _T.CreateEmbeddingRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateEmbedding200, _HttpClientResponse], _Errors]: ...
def create_embedding(self, *, payload: _T.CreateEmbeddingRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates an embedding vector representing the input text."""
return self._json(_CREATE_EMBEDDING, "/embeddings", None, _c.json_body(payload), include_response)list_evals#
list_evals(*, params: _T.ListEvalsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListEvals200, _Errors]
list_evals(*, params: _T.ListEvalsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListEvals200, _HttpClientResponse], _Errors]List evaluations for a project.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_evals(self, *, params: _T.ListEvalsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListEvals200, _Errors]: ...
@_t.overload
def list_evals(self, *, params: _T.ListEvalsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListEvals200, _HttpClientResponse], _Errors]: ...
def list_evals(self, *, params: _T.ListEvalsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List evaluations for a project."""
return self._json(_LIST_EVALS, "/evals", params, None, include_response)create_eval#
create_eval(*, payload: _T.CreateEvalRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateEval201, _Errors]
create_eval(*, payload: _T.CreateEvalRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateEval201, _HttpClientResponse], _Errors]Create the structure of an evaluation that can be used to test a model's performance. An evaluation is a set of testing criteria and the config for a data source, which dictates the schema of the data used in the evaluation. After creating an evaluation, you can run it on different models and model parameters. We support several types of graders and datasources. For more information, see the Evals guide.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_eval(self, *, payload: _T.CreateEvalRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateEval201, _Errors]: ...
@_t.overload
def create_eval(self, *, payload: _T.CreateEvalRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateEval201, _HttpClientResponse], _Errors]: ...
def create_eval(self, *, payload: _T.CreateEvalRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create the structure of an evaluation that can be used to test a model's performance.
An evaluation is a set of testing criteria and the config for a data source, which dictates the schema of the data used in the evaluation. After creating an evaluation, you can run it on different models and model parameters. We support several types of graders and datasources.
For more information, see the [Evals guide](https://developers.openai.com/api/docs/guides/evals)."""
return self._json(_CREATE_EVAL, "/evals", None, _c.json_body(payload), include_response)get_eval#
get_eval(eval_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEval200, _Errors]
get_eval(eval_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEval200, _HttpClientResponse], _Errors]Get an evaluation by ID.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
include_response | = False |
@_t.overload
def get_eval(self, eval_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEval200, _Errors]: ...
@_t.overload
def get_eval(self, eval_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEval200, _HttpClientResponse], _Errors]: ...
def get_eval(self, eval_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get an evaluation by ID."""
return self._json(_GET_EVAL, _c.encoded_path("/evals/{}", eval_id), None, None, include_response)update_eval#
update_eval(eval_id: str, *, payload: _T.UpdateEvalRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateEval200, _Errors]
update_eval(eval_id: str, *, payload: _T.UpdateEvalRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateEval200, _HttpClientResponse], _Errors]Update certain properties of an evaluation.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_eval(self, eval_id: str, *, payload: _T.UpdateEvalRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateEval200, _Errors]: ...
@_t.overload
def update_eval(self, eval_id: str, *, payload: _T.UpdateEvalRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateEval200, _HttpClientResponse], _Errors]: ...
def update_eval(self, eval_id: str, *, payload: _T.UpdateEvalRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Update certain properties of an evaluation."""
return self._json(_UPDATE_EVAL, _c.encoded_path("/evals/{}", eval_id), None, _c.json_body(payload), include_response)delete_eval#
delete_eval(eval_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteEval200, _Errors]
delete_eval(eval_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteEval200, _HttpClientResponse], _Errors]Delete an evaluation.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
include_response | = False |
@_t.overload
def delete_eval(self, eval_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteEval200, _Errors]: ...
@_t.overload
def delete_eval(self, eval_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteEval200, _HttpClientResponse], _Errors]: ...
def delete_eval(self, eval_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete an evaluation."""
return self._json(_DELETE_EVAL, _c.encoded_path("/evals/{}", eval_id), None, None, include_response)get_eval_runs#
get_eval_runs(eval_id: str, *, params: _T.GetEvalRunsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEvalRuns200, _Errors]
get_eval_runs(eval_id: str, *, params: _T.GetEvalRunsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEvalRuns200, _HttpClientResponse], _Errors]Get a list of runs for an evaluation.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
params | = None | |
include_response | = False |
@_t.overload
def get_eval_runs(self, eval_id: str, *, params: _T.GetEvalRunsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEvalRuns200, _Errors]: ...
@_t.overload
def get_eval_runs(self, eval_id: str, *, params: _T.GetEvalRunsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEvalRuns200, _HttpClientResponse], _Errors]: ...
def get_eval_runs(self, eval_id: str, *, params: _T.GetEvalRunsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a list of runs for an evaluation."""
return self._json(_GET_EVAL_RUNS, _c.encoded_path("/evals/{}/runs", eval_id), params, None, include_response)create_eval_run#
create_eval_run(eval_id: str, *, payload: _T.CreateEvalRunRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateEvalRun201, _Errors]
create_eval_run(eval_id: str, *, payload: _T.CreateEvalRunRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateEvalRun201, _HttpClientResponse], _Errors]Kicks off a new run for a given evaluation, specifying the data source, and what model configuration to use to test. The datasource will be validated against the schema specified in the config of the evaluation.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_eval_run(self, eval_id: str, *, payload: _T.CreateEvalRunRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateEvalRun201, _Errors]: ...
@_t.overload
def create_eval_run(self, eval_id: str, *, payload: _T.CreateEvalRunRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateEvalRun201, _HttpClientResponse], _Errors]: ...
def create_eval_run(self, eval_id: str, *, payload: _T.CreateEvalRunRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Kicks off a new run for a given evaluation, specifying the data source, and what model configuration to use to test. The datasource will be validated against the schema specified in the config of the evaluation."""
return self._json(_CREATE_EVAL_RUN, _c.encoded_path("/evals/{}/runs", eval_id), None, _c.json_body(payload), include_response)get_eval_run#
get_eval_run(eval_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEvalRun200, _Errors]
get_eval_run(eval_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEvalRun200, _HttpClientResponse], _Errors]Get an evaluation run by ID.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
run_id | ||
include_response | = False |
@_t.overload
def get_eval_run(self, eval_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEvalRun200, _Errors]: ...
@_t.overload
def get_eval_run(self, eval_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEvalRun200, _HttpClientResponse], _Errors]: ...
def get_eval_run(self, eval_id: str, run_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get an evaluation run by ID."""
return self._json(_GET_EVAL_RUN, _c.encoded_path("/evals/{}/runs/{}", eval_id, run_id), None, None, include_response)delete_eval_run#
delete_eval_run(eval_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteEvalRun200, _Errors]
delete_eval_run(eval_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteEvalRun200, _HttpClientResponse], _Errors]Delete an eval run.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
run_id | ||
include_response | = False |
@_t.overload
def delete_eval_run(self, eval_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteEvalRun200, _Errors]: ...
@_t.overload
def delete_eval_run(self, eval_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteEvalRun200, _HttpClientResponse], _Errors]: ...
def delete_eval_run(self, eval_id: str, run_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete an eval run."""
return self._json(_DELETE_EVAL_RUN, _c.encoded_path("/evals/{}/runs/{}", eval_id, run_id), None, None, include_response)cancel_eval_run#
cancel_eval_run(eval_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelEvalRun200, _Errors]
cancel_eval_run(eval_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelEvalRun200, _HttpClientResponse], _Errors]Cancel an ongoing evaluation run.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
run_id | ||
include_response | = False |
@_t.overload
def cancel_eval_run(self, eval_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelEvalRun200, _Errors]: ...
@_t.overload
def cancel_eval_run(self, eval_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelEvalRun200, _HttpClientResponse], _Errors]: ...
def cancel_eval_run(self, eval_id: str, run_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Cancel an ongoing evaluation run."""
return self._json(_CANCEL_EVAL_RUN, _c.encoded_path("/evals/{}/runs/{}/cancel", eval_id, run_id), None, None, include_response)get_eval_run_output_items#
get_eval_run_output_items(eval_id: str, run_id: str, *, params: _T.GetEvalRunOutputItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEvalRunOutputItems200, _Errors]
get_eval_run_output_items(eval_id: str, run_id: str, *, params: _T.GetEvalRunOutputItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEvalRunOutputItems200, _HttpClientResponse], _Errors]Get a list of output items for an evaluation run.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
run_id | ||
params | = None | |
include_response | = False |
@_t.overload
def get_eval_run_output_items(self, eval_id: str, run_id: str, *, params: _T.GetEvalRunOutputItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEvalRunOutputItems200, _Errors]: ...
@_t.overload
def get_eval_run_output_items(self, eval_id: str, run_id: str, *, params: _T.GetEvalRunOutputItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEvalRunOutputItems200, _HttpClientResponse], _Errors]: ...
def get_eval_run_output_items(self, eval_id: str, run_id: str, *, params: _T.GetEvalRunOutputItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a list of output items for an evaluation run."""
return self._json(_GET_EVAL_RUN_OUTPUT_ITEMS, _c.encoded_path("/evals/{}/runs/{}/output_items", eval_id, run_id), params, None, include_response)get_eval_run_output_item#
get_eval_run_output_item(eval_id: str, run_id: str, output_item_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEvalRunOutputItem200, _Errors]
get_eval_run_output_item(eval_id: str, run_id: str, output_item_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEvalRunOutputItem200, _HttpClientResponse], _Errors]Get an evaluation run output item by ID.
| Parameter | Type | Description |
|---|---|---|
eval_id | ||
run_id | ||
output_item_id | ||
include_response | = False |
@_t.overload
def get_eval_run_output_item(self, eval_id: str, run_id: str, output_item_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetEvalRunOutputItem200, _Errors]: ...
@_t.overload
def get_eval_run_output_item(self, eval_id: str, run_id: str, output_item_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetEvalRunOutputItem200, _HttpClientResponse], _Errors]: ...
def get_eval_run_output_item(self, eval_id: str, run_id: str, output_item_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get an evaluation run output item by ID."""
return self._json(_GET_EVAL_RUN_OUTPUT_ITEM, _c.encoded_path("/evals/{}/runs/{}/output_items/{}", eval_id, run_id, output_item_id), None, None, include_response)list_files#
list_files(*, params: _T.ListFilesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFiles200, _Errors]
list_files(*, params: _T.ListFilesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFiles200, _HttpClientResponse], _Errors]Returns a list of files.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_files(self, *, params: _T.ListFilesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFiles200, _Errors]: ...
@_t.overload
def list_files(self, *, params: _T.ListFilesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFiles200, _HttpClientResponse], _Errors]: ...
def list_files(self, *, params: _T.ListFilesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of files."""
return self._json(_LIST_FILES, "/files", params, None, include_response)create_file#
create_file(*, payload: _T.CreateFileRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateFile200, _Errors]
create_file(*, payload: _T.CreateFileRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateFile200, _HttpClientResponse], _Errors]Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and each project can store up to 2.5 TB of files in total. There is no organization-wide storage limit. Uploads to this endpoint are rate-limited to 1,000 requests per minute per authenticated user.
- The Assistants API supports files up to 2 million tokens and of specific file types. See the Assistants Tools guide for details.
- The Fine-tuning API only supports
.jsonlfiles. The input also has certain required formats for fine-tuning chat or completions models. - The Batch API only supports
.jsonlfiles up to 200 MB in size. The input also has a specific required format. - For Retrieval or
file_searchingestion, upload files here first. If you need to attach multiple uploaded files to the same vector store, use/vector_stores/{vector_store_id}/file_batchesinstead of attaching them one by one. Vector store attachment has separate limits from file upload, including 2,000 attached files per minute per organization.
Please contact us if you need to increase these storage limits.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_file(self, *, payload: _T.CreateFileRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateFile200, _Errors]: ...
@_t.overload
def create_file(self, *, payload: _T.CreateFileRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateFile200, _HttpClientResponse], _Errors]: ...
def create_file(self, *, payload: _T.CreateFileRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Upload a file that can be used across various endpoints. Individual files
can be up to 512 MB, and each project can store up to 2.5 TB of files in
total. There is no organization-wide storage limit. Uploads to this
endpoint are rate-limited to 1,000 requests per minute per authenticated
user.
- The Assistants API supports files up to 2 million tokens and of specific
file types. See the [Assistants Tools guide](https://developers.openai.com/api/docs/guides/tools) for
details.
- The Fine-tuning API only supports `.jsonl` files. The input also has
certain required formats for fine-tuning
[chat](https://developers.openai.com/api/docs/guides/supervised-fine-tuning#formatting-your-data) or
[completions](https://developers.openai.com/api/docs/guides/supervised-fine-tuning#formatting-your-data) models.
- The Batch API only supports `.jsonl` files up to 200 MB in size. The input
also has a specific required
[format](https://developers.openai.com/api/docs/guides/batch#1-prepare-your-batch-file).
- For Retrieval or `file_search` ingestion, upload files here first. If
you need to attach multiple uploaded files to the same vector store, use
[`/vector_stores/{vector_store_id}/file_batches`](https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/create)
instead of attaching them one by one. Vector store attachment has separate
limits from file upload, including 2,000 attached files per minute per
organization.
Please [contact us](https://help.openai.com/) if you need to increase these
storage limits."""
return self._json(_CREATE_FILE, "/files", None, _c.form_body(payload), include_response)retrieve_file#
retrieve_file(file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveFile200, _Errors]
retrieve_file(file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveFile200, _HttpClientResponse], _Errors]Returns information about a specific file.
| Parameter | Type | Description |
|---|---|---|
file_id | ||
include_response | = False |
@_t.overload
def retrieve_file(self, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveFile200, _Errors]: ...
@_t.overload
def retrieve_file(self, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveFile200, _HttpClientResponse], _Errors]: ...
def retrieve_file(self, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns information about a specific file."""
return self._json(_RETRIEVE_FILE, _c.encoded_path("/files/{}", file_id), None, None, include_response)delete_file#
delete_file(file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteFile200, _Errors]
delete_file(file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteFile200, _HttpClientResponse], _Errors]Delete a file and remove it from all vector stores.
| Parameter | Type | Description |
|---|---|---|
file_id | ||
include_response | = False |
@_t.overload
def delete_file(self, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteFile200, _Errors]: ...
@_t.overload
def delete_file(self, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteFile200, _HttpClientResponse], _Errors]: ...
def delete_file(self, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a file and remove it from all vector stores."""
return self._json(_DELETE_FILE, _c.encoded_path("/files/{}", file_id), None, None, include_response)download_file#
download_file(file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]
download_file(file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]Returns a response containing the contents of the specified file.
| Parameter | Type | Description |
|---|---|---|
file_id | ||
include_response | = False |
@_t.overload
def download_file(self, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]: ...
@_t.overload
def download_file(self, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]: ...
def download_file(self, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a response containing the contents of the specified file."""
return self._json(_DOWNLOAD_FILE, _c.encoded_path("/files/{}/content", file_id), None, None, include_response)download_file_stream#
download_file_stream(file_id) -> _Stream[bytes, _HttpClientError]Returns a response containing the contents of the specified file.
| Parameter | Type | Description |
|---|---|---|
file_id | str |
Returns _Stream[bytes, _HttpClientError]
def download_file_stream(self, file_id: str) -> _Stream[bytes, _HttpClientError]:
"""Returns a response containing the contents of the specified file."""
return self._binary(_DOWNLOAD_FILE_STREAM, _c.encoded_path("/files/{}/content", file_id), None, None)run_grader#
run_grader(*, payload: _T.RunGraderRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.RunGrader200, _Errors]
run_grader(*, payload: _T.RunGraderRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RunGrader200, _HttpClientResponse], _Errors]Run a grader.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def run_grader(self, *, payload: _T.RunGraderRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.RunGrader200, _Errors]: ...
@_t.overload
def run_grader(self, *, payload: _T.RunGraderRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RunGrader200, _HttpClientResponse], _Errors]: ...
def run_grader(self, *, payload: _T.RunGraderRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Run a grader."""
return self._json(_RUN_GRADER, "/fine_tuning/alpha/graders/run", None, _c.json_body(payload), include_response)validate_grader#
validate_grader(*, payload: _T.ValidateGraderRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ValidateGrader200, _Errors]
validate_grader(*, payload: _T.ValidateGraderRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ValidateGrader200, _HttpClientResponse], _Errors]Validate a grader.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def validate_grader(self, *, payload: _T.ValidateGraderRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ValidateGrader200, _Errors]: ...
@_t.overload
def validate_grader(self, *, payload: _T.ValidateGraderRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ValidateGrader200, _HttpClientResponse], _Errors]: ...
def validate_grader(self, *, payload: _T.ValidateGraderRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Validate a grader."""
return self._json(_VALIDATE_GRADER, "/fine_tuning/alpha/graders/validate", None, _c.json_body(payload), include_response)list_fine_tuning_checkpoint_permissions#
list_fine_tuning_checkpoint_permissions(fine_tuned_model_checkpoint: str, *, params: _T.ListFineTuningCheckpointPermissionsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFineTuningCheckpointPermissions200, _Errors]
list_fine_tuning_checkpoint_permissions(fine_tuned_model_checkpoint: str, *, params: _T.ListFineTuningCheckpointPermissionsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFineTuningCheckpointPermissions200, _HttpClientResponse], _Errors]NOTE: This endpoint requires an admin API key.
Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.
| Parameter | Type | Description |
|---|---|---|
fine_tuned_model_checkpoint | ||
params | = None | |
include_response | = False |
@_t.overload
def list_fine_tuning_checkpoint_permissions(self, fine_tuned_model_checkpoint: str, *, params: _T.ListFineTuningCheckpointPermissionsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFineTuningCheckpointPermissions200, _Errors]: ...
@_t.overload
def list_fine_tuning_checkpoint_permissions(self, fine_tuned_model_checkpoint: str, *, params: _T.ListFineTuningCheckpointPermissionsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFineTuningCheckpointPermissions200, _HttpClientResponse], _Errors]: ...
def list_fine_tuning_checkpoint_permissions(self, fine_tuned_model_checkpoint: str, *, params: _T.ListFineTuningCheckpointPermissionsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""**NOTE:** This endpoint requires an [admin API key](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys).
Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint."""
return self._json(_LIST_FINE_TUNING_CHECKPOINT_PERMISSIONS, _c.encoded_path("/fine_tuning/checkpoints/{}/permissions", fine_tuned_model_checkpoint), params, None, include_response)create_fine_tuning_checkpoint_permission#
create_fine_tuning_checkpoint_permission(fine_tuned_model_checkpoint: str, *, payload: _T.CreateFineTuningCheckpointPermissionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateFineTuningCheckpointPermission200, _Errors]
create_fine_tuning_checkpoint_permission(fine_tuned_model_checkpoint: str, *, payload: _T.CreateFineTuningCheckpointPermissionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateFineTuningCheckpointPermission200, _HttpClientResponse], _Errors]NOTE: Calling this endpoint requires an admin API key.
This enables organization owners to share fine-tuned models with other projects in their organization.
| Parameter | Type | Description |
|---|---|---|
fine_tuned_model_checkpoint | ||
payload | ||
include_response | = False |
@_t.overload
def create_fine_tuning_checkpoint_permission(self, fine_tuned_model_checkpoint: str, *, payload: _T.CreateFineTuningCheckpointPermissionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateFineTuningCheckpointPermission200, _Errors]: ...
@_t.overload
def create_fine_tuning_checkpoint_permission(self, fine_tuned_model_checkpoint: str, *, payload: _T.CreateFineTuningCheckpointPermissionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateFineTuningCheckpointPermission200, _HttpClientResponse], _Errors]: ...
def create_fine_tuning_checkpoint_permission(self, fine_tuned_model_checkpoint: str, *, payload: _T.CreateFineTuningCheckpointPermissionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""**NOTE:** Calling this endpoint requires an [admin API key](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys).
This enables organization owners to share fine-tuned models with other projects in their organization."""
return self._json(_CREATE_FINE_TUNING_CHECKPOINT_PERMISSION, _c.encoded_path("/fine_tuning/checkpoints/{}/permissions", fine_tuned_model_checkpoint), None, _c.json_body(payload), include_response)delete_fine_tuning_checkpoint_permission#
delete_fine_tuning_checkpoint_permission(fine_tuned_model_checkpoint: str, permission_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteFineTuningCheckpointPermission200, _Errors]
delete_fine_tuning_checkpoint_permission(fine_tuned_model_checkpoint: str, permission_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteFineTuningCheckpointPermission200, _HttpClientResponse], _Errors]NOTE: This endpoint requires an admin API key.
Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint.
| Parameter | Type | Description |
|---|---|---|
fine_tuned_model_checkpoint | ||
permission_id | ||
include_response | = False |
@_t.overload
def delete_fine_tuning_checkpoint_permission(self, fine_tuned_model_checkpoint: str, permission_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteFineTuningCheckpointPermission200, _Errors]: ...
@_t.overload
def delete_fine_tuning_checkpoint_permission(self, fine_tuned_model_checkpoint: str, permission_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteFineTuningCheckpointPermission200, _HttpClientResponse], _Errors]: ...
def delete_fine_tuning_checkpoint_permission(self, fine_tuned_model_checkpoint: str, permission_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""**NOTE:** This endpoint requires an [admin API key](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys).
Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint."""
return self._json(_DELETE_FINE_TUNING_CHECKPOINT_PERMISSION, _c.encoded_path("/fine_tuning/checkpoints/{}/permissions/{}", fine_tuned_model_checkpoint, permission_id), None, None, include_response)list_paginated_fine_tuning_jobs#
list_paginated_fine_tuning_jobs(*, params: _T.ListPaginatedFineTuningJobsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListPaginatedFineTuningJobs200, _Errors]
list_paginated_fine_tuning_jobs(*, params: _T.ListPaginatedFineTuningJobsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListPaginatedFineTuningJobs200, _HttpClientResponse], _Errors]List your organization's fine-tuning jobs
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_paginated_fine_tuning_jobs(self, *, params: _T.ListPaginatedFineTuningJobsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListPaginatedFineTuningJobs200, _Errors]: ...
@_t.overload
def list_paginated_fine_tuning_jobs(self, *, params: _T.ListPaginatedFineTuningJobsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListPaginatedFineTuningJobs200, _HttpClientResponse], _Errors]: ...
def list_paginated_fine_tuning_jobs(self, *, params: _T.ListPaginatedFineTuningJobsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List your organization's fine-tuning jobs"""
return self._json(_LIST_PAGINATED_FINE_TUNING_JOBS, "/fine_tuning/jobs", params, None, include_response)create_fine_tuning_job#
create_fine_tuning_job(*, payload: _T.CreateFineTuningJobRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateFineTuningJob200, _Errors]
create_fine_tuning_job(*, payload: _T.CreateFineTuningJobRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateFineTuningJob200, _HttpClientResponse], _Errors]Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_fine_tuning_job(self, *, payload: _T.CreateFineTuningJobRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateFineTuningJob200, _Errors]: ...
@_t.overload
def create_fine_tuning_job(self, *, payload: _T.CreateFineTuningJobRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateFineTuningJob200, _HttpClientResponse], _Errors]: ...
def create_fine_tuning_job(self, *, payload: _T.CreateFineTuningJobRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
[Learn more about fine-tuning](https://developers.openai.com/api/docs/guides/model-optimization)"""
return self._json(_CREATE_FINE_TUNING_JOB, "/fine_tuning/jobs", None, _c.json_body(payload), include_response)retrieve_fine_tuning_job#
retrieve_fine_tuning_job(fine_tuning_job_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveFineTuningJob200, _Errors]
retrieve_fine_tuning_job(fine_tuning_job_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveFineTuningJob200, _HttpClientResponse], _Errors]Get info about a fine-tuning job.
| Parameter | Type | Description |
|---|---|---|
fine_tuning_job_id | ||
include_response | = False |
@_t.overload
def retrieve_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveFineTuningJob200, _Errors]: ...
@_t.overload
def retrieve_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveFineTuningJob200, _HttpClientResponse], _Errors]: ...
def retrieve_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get info about a fine-tuning job.
[Learn more about fine-tuning](https://developers.openai.com/api/docs/guides/model-optimization)"""
return self._json(_RETRIEVE_FINE_TUNING_JOB, _c.encoded_path("/fine_tuning/jobs/{}", fine_tuning_job_id), None, None, include_response)cancel_fine_tuning_job#
cancel_fine_tuning_job(fine_tuning_job_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelFineTuningJob200, _Errors]
cancel_fine_tuning_job(fine_tuning_job_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelFineTuningJob200, _HttpClientResponse], _Errors]Immediately cancel a fine-tune job.
| Parameter | Type | Description |
|---|---|---|
fine_tuning_job_id | ||
include_response | = False |
@_t.overload
def cancel_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelFineTuningJob200, _Errors]: ...
@_t.overload
def cancel_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelFineTuningJob200, _HttpClientResponse], _Errors]: ...
def cancel_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Immediately cancel a fine-tune job."""
return self._json(_CANCEL_FINE_TUNING_JOB, _c.encoded_path("/fine_tuning/jobs/{}/cancel", fine_tuning_job_id), None, None, include_response)list_fine_tuning_job_checkpoints#
list_fine_tuning_job_checkpoints(fine_tuning_job_id: str, *, params: _T.ListFineTuningJobCheckpointsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFineTuningJobCheckpoints200, _Errors]
list_fine_tuning_job_checkpoints(fine_tuning_job_id: str, *, params: _T.ListFineTuningJobCheckpointsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFineTuningJobCheckpoints200, _HttpClientResponse], _Errors]List checkpoints for a fine-tuning job.
| Parameter | Type | Description |
|---|---|---|
fine_tuning_job_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_fine_tuning_job_checkpoints(self, fine_tuning_job_id: str, *, params: _T.ListFineTuningJobCheckpointsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFineTuningJobCheckpoints200, _Errors]: ...
@_t.overload
def list_fine_tuning_job_checkpoints(self, fine_tuning_job_id: str, *, params: _T.ListFineTuningJobCheckpointsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFineTuningJobCheckpoints200, _HttpClientResponse], _Errors]: ...
def list_fine_tuning_job_checkpoints(self, fine_tuning_job_id: str, *, params: _T.ListFineTuningJobCheckpointsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List checkpoints for a fine-tuning job."""
return self._json(_LIST_FINE_TUNING_JOB_CHECKPOINTS, _c.encoded_path("/fine_tuning/jobs/{}/checkpoints", fine_tuning_job_id), params, None, include_response)list_fine_tuning_events#
list_fine_tuning_events(fine_tuning_job_id: str, *, params: _T.ListFineTuningEventsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFineTuningEvents200, _Errors]
list_fine_tuning_events(fine_tuning_job_id: str, *, params: _T.ListFineTuningEventsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFineTuningEvents200, _HttpClientResponse], _Errors]Get status updates for a fine-tuning job.
| Parameter | Type | Description |
|---|---|---|
fine_tuning_job_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_fine_tuning_events(self, fine_tuning_job_id: str, *, params: _T.ListFineTuningEventsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFineTuningEvents200, _Errors]: ...
@_t.overload
def list_fine_tuning_events(self, fine_tuning_job_id: str, *, params: _T.ListFineTuningEventsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFineTuningEvents200, _HttpClientResponse], _Errors]: ...
def list_fine_tuning_events(self, fine_tuning_job_id: str, *, params: _T.ListFineTuningEventsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get status updates for a fine-tuning job."""
return self._json(_LIST_FINE_TUNING_EVENTS, _c.encoded_path("/fine_tuning/jobs/{}/events", fine_tuning_job_id), params, None, include_response)pause_fine_tuning_job#
pause_fine_tuning_job(fine_tuning_job_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.PauseFineTuningJob200, _Errors]
pause_fine_tuning_job(fine_tuning_job_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.PauseFineTuningJob200, _HttpClientResponse], _Errors]Pause a fine-tune job.
| Parameter | Type | Description |
|---|---|---|
fine_tuning_job_id | ||
include_response | = False |
@_t.overload
def pause_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.PauseFineTuningJob200, _Errors]: ...
@_t.overload
def pause_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.PauseFineTuningJob200, _HttpClientResponse], _Errors]: ...
def pause_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Pause a fine-tune job."""
return self._json(_PAUSE_FINE_TUNING_JOB, _c.encoded_path("/fine_tuning/jobs/{}/pause", fine_tuning_job_id), None, None, include_response)resume_fine_tuning_job#
resume_fine_tuning_job(fine_tuning_job_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.ResumeFineTuningJob200, _Errors]
resume_fine_tuning_job(fine_tuning_job_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ResumeFineTuningJob200, _HttpClientResponse], _Errors]Resume a fine-tune job.
| Parameter | Type | Description |
|---|---|---|
fine_tuning_job_id | ||
include_response | = False |
@_t.overload
def resume_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.ResumeFineTuningJob200, _Errors]: ...
@_t.overload
def resume_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ResumeFineTuningJob200, _HttpClientResponse], _Errors]: ...
def resume_fine_tuning_job(self, fine_tuning_job_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Resume a fine-tune job."""
return self._json(_RESUME_FINE_TUNING_JOB, _c.encoded_path("/fine_tuning/jobs/{}/resume", fine_tuning_job_id), None, None, include_response)create_image_edit#
create_image_edit(*, payload: _T.CreateImageEditRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateImageEdit200, _Errors]
create_image_edit(*, payload: _T.CreateImageEditRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateImageEdit200, _HttpClientResponse], _Errors]Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_image_edit(self, *, payload: _T.CreateImageEditRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateImageEdit200, _Errors]: ...
@_t.overload
def create_image_edit(self, *, payload: _T.CreateImageEditRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateImageEdit200, _HttpClientResponse], _Errors]: ...
def create_image_edit(self, *, payload: _T.CreateImageEditRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models."""
return self._json(_CREATE_IMAGE_EDIT, "/images/edits", None, _c.form_body(payload), include_response)create_image_edit_sse#
create_image_edit_sse(*, payload) -> _Stream[_sse.DataEvent[_T.CreateImageEdit200Sse], _SseErrors]Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateImageEditRequestFormData |
Returns _Stream[_sse.DataEvent[_T.CreateImageEdit200Sse], _SseErrors]
def create_image_edit_sse(self, *, payload: _T.CreateImageEditRequestFormData) -> _Stream[_sse.DataEvent[_T.CreateImageEdit200Sse], _SseErrors]:
"""Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models."""
return self._sse(_CREATE_IMAGE_EDIT_SSE, "/images/edits", None, _c.form_body(payload), CreateImageEdit200Sse)create_image#
create_image(*, payload: _T.CreateImageRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateImage200, _Errors]
create_image(*, payload: _T.CreateImageRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateImage200, _HttpClientResponse], _Errors]Creates an image given a prompt using a GPT Image model. Learn more.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_image(self, *, payload: _T.CreateImageRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateImage200, _Errors]: ...
@_t.overload
def create_image(self, *, payload: _T.CreateImageRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateImage200, _HttpClientResponse], _Errors]: ...
def create_image(self, *, payload: _T.CreateImageRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision)."""
return self._json(_CREATE_IMAGE, "/images/generations", None, _c.json_body(payload), include_response)create_image_sse#
create_image_sse(*, payload) -> _Stream[_sse.DataEvent[_T.CreateImage200Sse], _SseErrors]Creates an image given a prompt using a GPT Image model. Learn more.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateImageRequestJson |
Returns _Stream[_sse.DataEvent[_T.CreateImage200Sse], _SseErrors]
def create_image_sse(self, *, payload: _T.CreateImageRequestJson) -> _Stream[_sse.DataEvent[_T.CreateImage200Sse], _SseErrors]:
"""Creates an image given a prompt using a GPT Image model. [Learn more](https://developers.openai.com/api/docs/guides/images-vision)."""
return self._sse(_CREATE_IMAGE_SSE, "/images/generations", None, _c.json_body(payload), CreateImage200Sse)create_image_variation#
create_image_variation(*, payload: _T.CreateImageVariationRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateImageVariation200, _Errors]
create_image_variation(*, payload: _T.CreateImageVariationRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateImageVariation200, _HttpClientResponse], _Errors]This endpoint is retired and no longer available. Use the image edits endpoint with a GPT Image model and a prompt to create a variation of an image. The request and response schemas below describe the legacy contract.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_image_variation(self, *, payload: _T.CreateImageVariationRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateImageVariation200, _Errors]: ...
@_t.overload
def create_image_variation(self, *, payload: _T.CreateImageVariationRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateImageVariation200, _HttpClientResponse], _Errors]: ...
def create_image_variation(self, *, payload: _T.CreateImageVariationRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""This endpoint is retired and no longer available. Use the image edits endpoint with a GPT Image model and a prompt to create a variation of an image. The request and response schemas below describe the legacy contract."""
return self._json(_CREATE_IMAGE_VARIATION, "/images/variations", None, _c.form_body(payload), include_response)create_live#
create_live(*, payload: _T.CreateLiveRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateLive201, _Errors]
create_live(*, payload: _T.CreateLiveRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateLive201, _HttpClientResponse], _Errors]Create a Live WebRTC session or place an outbound SIP call. Start with the Live prompting guide for session configuration and Telephony and SIP for trunk setup and call monitoring.
Set transport.type to webrtc and supply an SDP offer, or set it to sip
and supply an E.164 destination and trunk credentials. Outbound SIP calling
must be enabled for your organization.
Ringing is limited to 3 minutes and connected calls to 2 hours; these limits
are not configurable in the request.
Returns 201 Created after session initialization. WebRTC responses include an
SDP answer. SIP responses do not wait for the callee to answer. Attach a
sideband connection using session.id to monitor SIP call progress.
Each SIP request creates a new call. If a request times out or the connection fails, retry with caution: the original request may have succeeded, and a retry can place another call.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_live(self, *, payload: _T.CreateLiveRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateLive201, _Errors]: ...
@_t.overload
def create_live(self, *, payload: _T.CreateLiveRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateLive201, _HttpClientResponse], _Errors]: ...
def create_live(self, *, payload: _T.CreateLiveRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a Live WebRTC session or place an outbound SIP call. Start with the
[Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting) for session configuration
and [Telephony and SIP](https://developers.openai.com/api/docs/guides/voice-sip?api=live#place-an-outbound-call)
for trunk setup and call monitoring.
Set transport.type to `webrtc` and supply an SDP offer, or set it to `sip`
and supply an E.164 destination and trunk credentials. Outbound SIP calling
must be enabled for your organization.
Ringing is limited to 3 minutes and connected calls to 2 hours; these limits
are not configurable in the request.
Returns `201 Created` after session initialization. WebRTC responses include an
SDP answer. SIP responses do not wait for the callee to answer. Attach a
sideband connection using session.id to monitor SIP call progress.
Each SIP request creates a new call. If a request times out or the connection
fails, retry with caution: the original request may have succeeded, and a
retry can place another call."""
return self._json(_CREATE_LIVE, "/live/sessions", None, _c.json_body(payload), include_response)accept_live_session#
accept_live_session(session_id: str, *, payload: _T.AcceptLiveSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
accept_live_session(session_id: str, *, payload: _T.AcceptLiveSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]Accept an incoming SIP call. Supply session with type live, the model, and startup configuration. Before accepting calls, follow the Live prompting guide to write frontend conversation instructions and a separate backend prompt. SIP media format is negotiated; omit audio.format.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
payload | ||
include_response | = False |
@_t.overload
def accept_live_session(self, session_id: str, *, payload: _T.AcceptLiveSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def accept_live_session(self, session_id: str, *, payload: _T.AcceptLiveSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def accept_live_session(self, session_id: str, *, payload: _T.AcceptLiveSessionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Accept an incoming SIP call. Supply session with type live, the model, and startup configuration. Before accepting calls, follow the [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting) to write frontend conversation instructions and a separate backend prompt. SIP media format is negotiated; omit audio.format."""
return self._json(_ACCEPT_LIVE_SESSION, _c.encoded_path("/live/sessions/{}/accept", session_id), None, _c.json_body(payload), include_response)fork_live_session#
fork_live_session(session_id: str, *, payload: _T.ForkLiveSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ForkLiveSession201, _Errors]
fork_live_session(session_id: str, *, payload: _T.ForkLiveSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ForkLiveSession201, _HttpClientResponse], _Errors]Fork a stored Live session onto a new WebRTC connection.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
payload | ||
include_response | = False |
@_t.overload
def fork_live_session(self, session_id: str, *, payload: _T.ForkLiveSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ForkLiveSession201, _Errors]: ...
@_t.overload
def fork_live_session(self, session_id: str, *, payload: _T.ForkLiveSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ForkLiveSession201, _HttpClientResponse], _Errors]: ...
def fork_live_session(self, session_id: str, *, payload: _T.ForkLiveSessionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Fork a stored Live session onto a new WebRTC connection."""
return self._json(_FORK_LIVE_SESSION, _c.encoded_path("/live/sessions/{}/fork", session_id), None, _c.json_body(payload), include_response)hangup_live_session#
hangup_live_session(session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
hangup_live_session(session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]End a SIP call identified by session_id.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
include_response | = False |
@_t.overload
def hangup_live_session(self, session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def hangup_live_session(self, session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def hangup_live_session(self, session_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""End a SIP call identified by session_id."""
return self._json(_HANGUP_LIVE_SESSION, _c.encoded_path("/live/sessions/{}/hangup", session_id), None, None, include_response)refer_live_session#
refer_live_session(session_id: str, *, payload: _T.ReferLiveSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
refer_live_session(session_id: str, *, payload: _T.ReferLiveSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]Transfer a SIP call to another destination. Supply a nonblank target_uri for the SIP Refer-To header.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
payload | ||
include_response | = False |
@_t.overload
def refer_live_session(self, session_id: str, *, payload: _T.ReferLiveSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def refer_live_session(self, session_id: str, *, payload: _T.ReferLiveSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def refer_live_session(self, session_id: str, *, payload: _T.ReferLiveSessionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Transfer a SIP call to another destination. Supply a nonblank target_uri for the SIP Refer-To header."""
return self._json(_REFER_LIVE_SESSION, _c.encoded_path("/live/sessions/{}/refer", session_id), None, _c.json_body(payload), include_response)reject_live_session#
reject_live_session(session_id: str, *, payload: _T.RejectLiveSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
reject_live_session(session_id: str, *, payload: _T.RejectLiveSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]Reject an incoming SIP call. Send a required SIP rejection status_code between 300 and 699.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
payload | ||
include_response | = False |
@_t.overload
def reject_live_session(self, session_id: str, *, payload: _T.RejectLiveSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def reject_live_session(self, session_id: str, *, payload: _T.RejectLiveSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def reject_live_session(self, session_id: str, *, payload: _T.RejectLiveSessionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Reject an incoming SIP call. Send a required SIP rejection status_code between 300 and 699."""
return self._json(_REJECT_LIVE_SESSION, _c.encoded_path("/live/sessions/{}/reject", session_id), None, _c.json_body(payload), include_response)list_models#
list_models(*, include_response: _t.Literal[False] = False) -> _Effect[_T.ListModels200, _Errors]
list_models(*, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListModels200, _HttpClientResponse], _Errors]Lists the currently available models, and provides basic information about each one such as the owner and availability.
| Parameter | Type | Description |
|---|---|---|
include_response | = False |
@_t.overload
def list_models(self, *, include_response: _t.Literal[False] = False) -> _Effect[_T.ListModels200, _Errors]: ...
@_t.overload
def list_models(self, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListModels200, _HttpClientResponse], _Errors]: ...
def list_models(self, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the currently available models, and provides basic information about each one such as the owner and availability."""
return self._json(_LIST_MODELS, "/models", None, None, include_response)retrieve_model#
retrieve_model(model: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveModel200, _Errors]
retrieve_model(model: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveModel200, _HttpClientResponse], _Errors]Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
| Parameter | Type | Description |
|---|---|---|
model | ||
include_response | = False |
@_t.overload
def retrieve_model(self, model: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveModel200, _Errors]: ...
@_t.overload
def retrieve_model(self, model: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveModel200, _HttpClientResponse], _Errors]: ...
def retrieve_model(self, model: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a model instance, providing basic information about the model such as the owner and permissioning."""
return self._json(_RETRIEVE_MODEL, _c.encoded_path("/models/{}", model), None, None, include_response)delete_model#
delete_model(model: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteModel200, _Errors]
delete_model(model: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteModel200, _HttpClientResponse], _Errors]Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
| Parameter | Type | Description |
|---|---|---|
model | ||
include_response | = False |
@_t.overload
def delete_model(self, model: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteModel200, _Errors]: ...
@_t.overload
def delete_model(self, model: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteModel200, _HttpClientResponse], _Errors]: ...
def delete_model(self, model: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a fine-tuned model. You must have the Owner role in your organization to delete a model."""
return self._json(_DELETE_MODEL, _c.encoded_path("/models/{}", model), None, None, include_response)create_moderation#
create_moderation(*, payload: _T.CreateModerationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateModeration200, _Errors]
create_moderation(*, payload: _T.CreateModerationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateModeration200, _HttpClientResponse], _Errors]Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_moderation(self, *, payload: _T.CreateModerationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateModeration200, _Errors]: ...
@_t.overload
def create_moderation(self, *, payload: _T.CreateModerationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateModeration200, _HttpClientResponse], _Errors]: ...
def create_moderation(self, *, payload: _T.CreateModerationRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Classifies if text and/or image inputs are potentially harmful. Learn
more in the [moderation guide](https://developers.openai.com/api/docs/guides/moderation)."""
return self._json(_CREATE_MODERATION, "/moderations", None, _c.json_body(payload), include_response)admin_api_keys_list#
admin_api_keys_list(*, params: _T.AdminApiKeysListParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.AdminApiKeysList200, _Errors]
admin_api_keys_list(*, params: _T.AdminApiKeysListParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AdminApiKeysList200, _HttpClientResponse], _Errors]List organization API keys
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def admin_api_keys_list(self, *, params: _T.AdminApiKeysListParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.AdminApiKeysList200, _Errors]: ...
@_t.overload
def admin_api_keys_list(self, *, params: _T.AdminApiKeysListParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AdminApiKeysList200, _HttpClientResponse], _Errors]: ...
def admin_api_keys_list(self, *, params: _T.AdminApiKeysListParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List organization API keys"""
return self._json(_ADMIN_API_KEYS_LIST, "/organization/admin_api_keys", params, None, include_response)admin_api_keys_create#
admin_api_keys_create(*, payload: _T.AdminApiKeysCreateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AdminApiKeysCreate200, _Errors]
admin_api_keys_create(*, payload: _T.AdminApiKeysCreateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AdminApiKeysCreate200, _HttpClientResponse], _Errors]Create an organization admin API key
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def admin_api_keys_create(self, *, payload: _T.AdminApiKeysCreateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AdminApiKeysCreate200, _Errors]: ...
@_t.overload
def admin_api_keys_create(self, *, payload: _T.AdminApiKeysCreateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AdminApiKeysCreate200, _HttpClientResponse], _Errors]: ...
def admin_api_keys_create(self, *, payload: _T.AdminApiKeysCreateRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create an organization admin API key"""
return self._json(_ADMIN_API_KEYS_CREATE, "/organization/admin_api_keys", None, _c.json_body(payload), include_response)admin_api_keys_get#
admin_api_keys_get(key_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.AdminApiKeysGet200, _Errors]
admin_api_keys_get(key_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AdminApiKeysGet200, _HttpClientResponse], _Errors]Retrieve a single organization API key
| Parameter | Type | Description |
|---|---|---|
key_id | ||
include_response | = False |
@_t.overload
def admin_api_keys_get(self, key_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.AdminApiKeysGet200, _Errors]: ...
@_t.overload
def admin_api_keys_get(self, key_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AdminApiKeysGet200, _HttpClientResponse], _Errors]: ...
def admin_api_keys_get(self, key_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieve a single organization API key"""
return self._json(_ADMIN_API_KEYS_GET, _c.encoded_path("/organization/admin_api_keys/{}", key_id), None, None, include_response)admin_api_keys_delete#
admin_api_keys_delete(key_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.AdminApiKeysDelete200, _Errors]
admin_api_keys_delete(key_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AdminApiKeysDelete200, _HttpClientResponse], _Errors]Delete an organization admin API key
| Parameter | Type | Description |
|---|---|---|
key_id | ||
include_response | = False |
@_t.overload
def admin_api_keys_delete(self, key_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.AdminApiKeysDelete200, _Errors]: ...
@_t.overload
def admin_api_keys_delete(self, key_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AdminApiKeysDelete200, _HttpClientResponse], _Errors]: ...
def admin_api_keys_delete(self, key_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete an organization admin API key"""
return self._json(_ADMIN_API_KEYS_DELETE, _c.encoded_path("/organization/admin_api_keys/{}", key_id), None, None, include_response)list_audit_logs#
list_audit_logs(*, params: _T.ListAuditLogsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAuditLogs200, _Errors]
list_audit_logs(*, params: _T.ListAuditLogsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAuditLogs200, _HttpClientResponse], _Errors]List user actions and configuration changes within this organization.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_audit_logs(self, *, params: _T.ListAuditLogsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAuditLogs200, _Errors]: ...
@_t.overload
def list_audit_logs(self, *, params: _T.ListAuditLogsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAuditLogs200, _HttpClientResponse], _Errors]: ...
def list_audit_logs(self, *, params: _T.ListAuditLogsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List user actions and configuration changes within this organization."""
return self._json(_LIST_AUDIT_LOGS, "/organization/audit_logs", params, None, include_response)list_organization_certificates#
list_organization_certificates(*, params: _T.ListOrganizationCertificatesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListOrganizationCertificates200, _Errors]
list_organization_certificates(*, params: _T.ListOrganizationCertificatesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListOrganizationCertificates200, _HttpClientResponse], _Errors]List uploaded certificates for this organization.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_organization_certificates(self, *, params: _T.ListOrganizationCertificatesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListOrganizationCertificates200, _Errors]: ...
@_t.overload
def list_organization_certificates(self, *, params: _T.ListOrganizationCertificatesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListOrganizationCertificates200, _HttpClientResponse], _Errors]: ...
def list_organization_certificates(self, *, params: _T.ListOrganizationCertificatesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List uploaded certificates for this organization."""
return self._json(_LIST_ORGANIZATION_CERTIFICATES, "/organization/certificates", params, None, include_response)upload_certificate#
upload_certificate(*, payload: _T.UploadCertificateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UploadCertificate200, _Errors]
upload_certificate(*, payload: _T.UploadCertificateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UploadCertificate200, _HttpClientResponse], _Errors]Upload a certificate to the organization. This does not automatically activate the certificate.
Organizations can upload up to 50 certificates.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def upload_certificate(self, *, payload: _T.UploadCertificateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UploadCertificate200, _Errors]: ...
@_t.overload
def upload_certificate(self, *, payload: _T.UploadCertificateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UploadCertificate200, _HttpClientResponse], _Errors]: ...
def upload_certificate(self, *, payload: _T.UploadCertificateRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Upload a certificate to the organization. This does **not** automatically activate the certificate.
Organizations can upload up to 50 certificates."""
return self._json(_UPLOAD_CERTIFICATE, "/organization/certificates", None, _c.json_body(payload), include_response)activate_organization_certificates#
activate_organization_certificates(*, payload: _T.ActivateOrganizationCertificatesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ActivateOrganizationCertificates200, _Errors]
activate_organization_certificates(*, payload: _T.ActivateOrganizationCertificatesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ActivateOrganizationCertificates200, _HttpClientResponse], _Errors]Activate certificates at the organization level.
You can atomically and idempotently activate up to 10 certificates at a time.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def activate_organization_certificates(self, *, payload: _T.ActivateOrganizationCertificatesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ActivateOrganizationCertificates200, _Errors]: ...
@_t.overload
def activate_organization_certificates(self, *, payload: _T.ActivateOrganizationCertificatesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ActivateOrganizationCertificates200, _HttpClientResponse], _Errors]: ...
def activate_organization_certificates(self, *, payload: _T.ActivateOrganizationCertificatesRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Activate certificates at the organization level.
You can atomically and idempotently activate up to 10 certificates at a time."""
return self._json(_ACTIVATE_ORGANIZATION_CERTIFICATES, "/organization/certificates/activate", None, _c.json_body(payload), include_response)deactivate_organization_certificates#
deactivate_organization_certificates(*, payload: _T.DeactivateOrganizationCertificatesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.DeactivateOrganizationCertificates200, _Errors]
deactivate_organization_certificates(*, payload: _T.DeactivateOrganizationCertificatesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeactivateOrganizationCertificates200, _HttpClientResponse], _Errors]Deactivate certificates at the organization level.
You can atomically and idempotently deactivate up to 10 certificates at a time.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def deactivate_organization_certificates(self, *, payload: _T.DeactivateOrganizationCertificatesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.DeactivateOrganizationCertificates200, _Errors]: ...
@_t.overload
def deactivate_organization_certificates(self, *, payload: _T.DeactivateOrganizationCertificatesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeactivateOrganizationCertificates200, _HttpClientResponse], _Errors]: ...
def deactivate_organization_certificates(self, *, payload: _T.DeactivateOrganizationCertificatesRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deactivate certificates at the organization level.
You can atomically and idempotently deactivate up to 10 certificates at a time."""
return self._json(_DEACTIVATE_ORGANIZATION_CERTIFICATES, "/organization/certificates/deactivate", None, _c.json_body(payload), include_response)get_certificate#
get_certificate(certificate_id: str, *, params: _T.GetCertificateParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetCertificate200, _Errors]
get_certificate(certificate_id: str, *, params: _T.GetCertificateParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetCertificate200, _HttpClientResponse], _Errors]Get a certificate that has been uploaded to the organization.
You can get a certificate regardless of whether it is active or not.
| Parameter | Type | Description |
|---|---|---|
certificate_id | ||
params | = None | |
include_response | = False |
@_t.overload
def get_certificate(self, certificate_id: str, *, params: _T.GetCertificateParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetCertificate200, _Errors]: ...
@_t.overload
def get_certificate(self, certificate_id: str, *, params: _T.GetCertificateParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetCertificate200, _HttpClientResponse], _Errors]: ...
def get_certificate(self, certificate_id: str, *, params: _T.GetCertificateParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a certificate that has been uploaded to the organization.
You can get a certificate regardless of whether it is active or not."""
return self._json(_GET_CERTIFICATE, _c.encoded_path("/organization/certificates/{}", certificate_id), params, None, include_response)modify_certificate#
modify_certificate(certificate_id: str, *, payload: _T.ModifyCertificateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyCertificate200, _Errors]
modify_certificate(certificate_id: str, *, payload: _T.ModifyCertificateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyCertificate200, _HttpClientResponse], _Errors]Modify a certificate. Note that only the name can be modified.
| Parameter | Type | Description |
|---|---|---|
certificate_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_certificate(self, certificate_id: str, *, payload: _T.ModifyCertificateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyCertificate200, _Errors]: ...
@_t.overload
def modify_certificate(self, certificate_id: str, *, payload: _T.ModifyCertificateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyCertificate200, _HttpClientResponse], _Errors]: ...
def modify_certificate(self, certificate_id: str, *, payload: _T.ModifyCertificateRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modify a certificate. Note that only the name can be modified."""
return self._json(_MODIFY_CERTIFICATE, _c.encoded_path("/organization/certificates/{}", certificate_id), None, _c.json_body(payload), include_response)delete_certificate#
delete_certificate(certificate_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteCertificate200, _Errors]
delete_certificate(certificate_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteCertificate200, _HttpClientResponse], _Errors]Delete a certificate from the organization.
The certificate must be inactive for the organization and all projects.
| Parameter | Type | Description |
|---|---|---|
certificate_id | ||
include_response | = False |
@_t.overload
def delete_certificate(self, certificate_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteCertificate200, _Errors]: ...
@_t.overload
def delete_certificate(self, certificate_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteCertificate200, _HttpClientResponse], _Errors]: ...
def delete_certificate(self, certificate_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a certificate from the organization.
The certificate must be inactive for the organization and all projects."""
return self._json(_DELETE_CERTIFICATE, _c.encoded_path("/organization/certificates/{}", certificate_id), None, None, include_response)usage_costs#
usage_costs(*, params: _T.UsageCostsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageCosts200, _Errors]
usage_costs(*, params: _T.UsageCostsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageCosts200, _HttpClientResponse], _Errors]Get costs details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_costs(self, *, params: _T.UsageCostsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageCosts200, _Errors]: ...
@_t.overload
def usage_costs(self, *, params: _T.UsageCostsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageCosts200, _HttpClientResponse], _Errors]: ...
def usage_costs(self, *, params: _T.UsageCostsParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get costs details for the organization."""
return self._json(_USAGE_COSTS, "/organization/costs", params, None, include_response)retrieve_organization_data_retention#
retrieve_organization_data_retention(*, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveOrganizationDataRetention200, _Errors]
retrieve_organization_data_retention(*, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveOrganizationDataRetention200, _HttpClientResponse], _Errors]Retrieves organization data retention controls.
| Parameter | Type | Description |
|---|---|---|
include_response | = False |
@_t.overload
def retrieve_organization_data_retention(self, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveOrganizationDataRetention200, _Errors]: ...
@_t.overload
def retrieve_organization_data_retention(self, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveOrganizationDataRetention200, _HttpClientResponse], _Errors]: ...
def retrieve_organization_data_retention(self, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves organization data retention controls."""
return self._json(_RETRIEVE_ORGANIZATION_DATA_RETENTION, "/organization/data_retention", None, None, include_response)update_organization_data_retention#
update_organization_data_retention(*, payload: _T.UpdateOrganizationDataRetentionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateOrganizationDataRetention200, _Errors]
update_organization_data_retention(*, payload: _T.UpdateOrganizationDataRetentionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateOrganizationDataRetention200, _HttpClientResponse], _Errors]Updates organization data retention controls.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def update_organization_data_retention(self, *, payload: _T.UpdateOrganizationDataRetentionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateOrganizationDataRetention200, _Errors]: ...
@_t.overload
def update_organization_data_retention(self, *, payload: _T.UpdateOrganizationDataRetentionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateOrganizationDataRetention200, _HttpClientResponse], _Errors]: ...
def update_organization_data_retention(self, *, payload: _T.UpdateOrganizationDataRetentionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates organization data retention controls."""
return self._json(_UPDATE_ORGANIZATION_DATA_RETENTION, "/organization/data_retention", None, _c.json_body(payload), include_response)list_groups#
list_groups(*, params: _T.ListGroupsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListGroups200, _Errors]
list_groups(*, params: _T.ListGroupsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListGroups200, _HttpClientResponse], _Errors]Lists all groups in the organization.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_groups(self, *, params: _T.ListGroupsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListGroups200, _Errors]: ...
@_t.overload
def list_groups(self, *, params: _T.ListGroupsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListGroups200, _HttpClientResponse], _Errors]: ...
def list_groups(self, *, params: _T.ListGroupsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists all groups in the organization."""
return self._json(_LIST_GROUPS, "/organization/groups", params, None, include_response)create_group#
create_group(*, payload: _T.CreateGroupRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateGroup200, _Errors]
create_group(*, payload: _T.CreateGroupRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateGroup200, _HttpClientResponse], _Errors]Creates a new group in the organization.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_group(self, *, payload: _T.CreateGroupRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateGroup200, _Errors]: ...
@_t.overload
def create_group(self, *, payload: _T.CreateGroupRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateGroup200, _HttpClientResponse], _Errors]: ...
def create_group(self, *, payload: _T.CreateGroupRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a new group in the organization."""
return self._json(_CREATE_GROUP, "/organization/groups", None, _c.json_body(payload), include_response)retrieve_group#
retrieve_group(group_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveGroup200, _Errors]
retrieve_group(group_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveGroup200, _HttpClientResponse], _Errors]Retrieves a group.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
include_response | = False |
@_t.overload
def retrieve_group(self, group_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveGroup200, _Errors]: ...
@_t.overload
def retrieve_group(self, group_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveGroup200, _HttpClientResponse], _Errors]: ...
def retrieve_group(self, group_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a group."""
return self._json(_RETRIEVE_GROUP, _c.encoded_path("/organization/groups/{}", group_id), None, None, include_response)update_group#
update_group(group_id: str, *, payload: _T.UpdateGroupRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateGroup200, _Errors]
update_group(group_id: str, *, payload: _T.UpdateGroupRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateGroup200, _HttpClientResponse], _Errors]Updates a group's information.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_group(self, group_id: str, *, payload: _T.UpdateGroupRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateGroup200, _Errors]: ...
@_t.overload
def update_group(self, group_id: str, *, payload: _T.UpdateGroupRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateGroup200, _HttpClientResponse], _Errors]: ...
def update_group(self, group_id: str, *, payload: _T.UpdateGroupRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates a group's information."""
return self._json(_UPDATE_GROUP, _c.encoded_path("/organization/groups/{}", group_id), None, _c.json_body(payload), include_response)delete_group#
delete_group(group_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteGroup200, _Errors]
delete_group(group_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteGroup200, _HttpClientResponse], _Errors]Deletes a group from the organization.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
include_response | = False |
@_t.overload
def delete_group(self, group_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteGroup200, _Errors]: ...
@_t.overload
def delete_group(self, group_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteGroup200, _HttpClientResponse], _Errors]: ...
def delete_group(self, group_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a group from the organization."""
return self._json(_DELETE_GROUP, _c.encoded_path("/organization/groups/{}", group_id), None, None, include_response)list_group_role_assignments#
list_group_role_assignments(group_id: str, *, params: _T.ListGroupRoleAssignmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListGroupRoleAssignments200, _Errors]
list_group_role_assignments(group_id: str, *, params: _T.ListGroupRoleAssignmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListGroupRoleAssignments200, _HttpClientResponse], _Errors]Lists the organization roles assigned to a group within the organization.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_group_role_assignments(self, group_id: str, *, params: _T.ListGroupRoleAssignmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListGroupRoleAssignments200, _Errors]: ...
@_t.overload
def list_group_role_assignments(self, group_id: str, *, params: _T.ListGroupRoleAssignmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListGroupRoleAssignments200, _HttpClientResponse], _Errors]: ...
def list_group_role_assignments(self, group_id: str, *, params: _T.ListGroupRoleAssignmentsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the organization roles assigned to a group within the organization."""
return self._json(_LIST_GROUP_ROLE_ASSIGNMENTS, _c.encoded_path("/organization/groups/{}/roles", group_id), params, None, include_response)assign_group_role#
assign_group_role(group_id: str, *, payload: _T.AssignGroupRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AssignGroupRole200, _Errors]
assign_group_role(group_id: str, *, payload: _T.AssignGroupRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AssignGroupRole200, _HttpClientResponse], _Errors]Assigns an organization role to a group within the organization.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
payload | ||
include_response | = False |
@_t.overload
def assign_group_role(self, group_id: str, *, payload: _T.AssignGroupRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AssignGroupRole200, _Errors]: ...
@_t.overload
def assign_group_role(self, group_id: str, *, payload: _T.AssignGroupRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AssignGroupRole200, _HttpClientResponse], _Errors]: ...
def assign_group_role(self, group_id: str, *, payload: _T.AssignGroupRoleRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Assigns an organization role to a group within the organization."""
return self._json(_ASSIGN_GROUP_ROLE, _c.encoded_path("/organization/groups/{}/roles", group_id), None, _c.json_body(payload), include_response)retrieve_group_role#
retrieve_group_role(group_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveGroupRole200, _Errors]
retrieve_group_role(group_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveGroupRole200, _HttpClientResponse], _Errors]Retrieves an organization role assigned to a group.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
role_id | ||
include_response | = False |
@_t.overload
def retrieve_group_role(self, group_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveGroupRole200, _Errors]: ...
@_t.overload
def retrieve_group_role(self, group_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveGroupRole200, _HttpClientResponse], _Errors]: ...
def retrieve_group_role(self, group_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves an organization role assigned to a group."""
return self._json(_RETRIEVE_GROUP_ROLE, _c.encoded_path("/organization/groups/{}/roles/{}", group_id, role_id), None, None, include_response)unassign_group_role#
unassign_group_role(group_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.UnassignGroupRole200, _Errors]
unassign_group_role(group_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UnassignGroupRole200, _HttpClientResponse], _Errors]Unassigns an organization role from a group within the organization.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
role_id | ||
include_response | = False |
@_t.overload
def unassign_group_role(self, group_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.UnassignGroupRole200, _Errors]: ...
@_t.overload
def unassign_group_role(self, group_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UnassignGroupRole200, _HttpClientResponse], _Errors]: ...
def unassign_group_role(self, group_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Unassigns an organization role from a group within the organization."""
return self._json(_UNASSIGN_GROUP_ROLE, _c.encoded_path("/organization/groups/{}/roles/{}", group_id, role_id), None, None, include_response)list_group_users#
list_group_users(group_id: str, *, params: _T.ListGroupUsersParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListGroupUsers200, _Errors]
list_group_users(group_id: str, *, params: _T.ListGroupUsersParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListGroupUsers200, _HttpClientResponse], _Errors]Lists the users assigned to a group.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_group_users(self, group_id: str, *, params: _T.ListGroupUsersParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListGroupUsers200, _Errors]: ...
@_t.overload
def list_group_users(self, group_id: str, *, params: _T.ListGroupUsersParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListGroupUsers200, _HttpClientResponse], _Errors]: ...
def list_group_users(self, group_id: str, *, params: _T.ListGroupUsersParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the users assigned to a group."""
return self._json(_LIST_GROUP_USERS, _c.encoded_path("/organization/groups/{}/users", group_id), params, None, include_response)add_group_user#
add_group_user(group_id: str, *, payload: _T.AddGroupUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AddGroupUser200, _Errors]
add_group_user(group_id: str, *, payload: _T.AddGroupUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AddGroupUser200, _HttpClientResponse], _Errors]Adds a user to a group.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
payload | ||
include_response | = False |
@_t.overload
def add_group_user(self, group_id: str, *, payload: _T.AddGroupUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AddGroupUser200, _Errors]: ...
@_t.overload
def add_group_user(self, group_id: str, *, payload: _T.AddGroupUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AddGroupUser200, _HttpClientResponse], _Errors]: ...
def add_group_user(self, group_id: str, *, payload: _T.AddGroupUserRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Adds a user to a group."""
return self._json(_ADD_GROUP_USER, _c.encoded_path("/organization/groups/{}/users", group_id), None, _c.json_body(payload), include_response)retrieve_group_user#
retrieve_group_user(group_id: str, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveGroupUser200, _Errors]
retrieve_group_user(group_id: str, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveGroupUser200, _HttpClientResponse], _Errors]Retrieves a user in a group.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
user_id | ||
include_response | = False |
@_t.overload
def retrieve_group_user(self, group_id: str, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveGroupUser200, _Errors]: ...
@_t.overload
def retrieve_group_user(self, group_id: str, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveGroupUser200, _HttpClientResponse], _Errors]: ...
def retrieve_group_user(self, group_id: str, user_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a user in a group."""
return self._json(_RETRIEVE_GROUP_USER, _c.encoded_path("/organization/groups/{}/users/{}", group_id, user_id), None, None, include_response)remove_group_user#
remove_group_user(group_id: str, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RemoveGroupUser200, _Errors]
remove_group_user(group_id: str, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RemoveGroupUser200, _HttpClientResponse], _Errors]Removes a user from a group.
| Parameter | Type | Description |
|---|---|---|
group_id | ||
user_id | ||
include_response | = False |
@_t.overload
def remove_group_user(self, group_id: str, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RemoveGroupUser200, _Errors]: ...
@_t.overload
def remove_group_user(self, group_id: str, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RemoveGroupUser200, _HttpClientResponse], _Errors]: ...
def remove_group_user(self, group_id: str, user_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Removes a user from a group."""
return self._json(_REMOVE_GROUP_USER, _c.encoded_path("/organization/groups/{}/users/{}", group_id, user_id), None, None, include_response)list_invites#
list_invites(*, params: _T.ListInvitesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListInvites200, _Errors]
list_invites(*, params: _T.ListInvitesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListInvites200, _HttpClientResponse], _Errors]Returns a list of invites in the organization.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_invites(self, *, params: _T.ListInvitesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListInvites200, _Errors]: ...
@_t.overload
def list_invites(self, *, params: _T.ListInvitesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListInvites200, _HttpClientResponse], _Errors]: ...
def list_invites(self, *, params: _T.ListInvitesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of invites in the organization."""
return self._json(_LIST_INVITES, "/organization/invites", params, None, include_response)invite_user#
invite_user(*, payload: _T.InviteUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.InviteUser200 | _T.InviteUser201, _Errors]
invite_user(*, payload: _T.InviteUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.InviteUser200 | _T.InviteUser201, _HttpClientResponse], _Errors]Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def invite_user(self, *, payload: _T.InviteUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.InviteUser200 | _T.InviteUser201, _Errors]: ...
@_t.overload
def invite_user(self, *, payload: _T.InviteUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.InviteUser200 | _T.InviteUser201, _HttpClientResponse], _Errors]: ...
def invite_user(self, *, payload: _T.InviteUserRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization."""
return self._json(_INVITE_USER, "/organization/invites", None, _c.json_body(payload), include_response)retrieve_invite#
retrieve_invite(invite_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveInvite200, _Errors]
retrieve_invite(invite_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveInvite200, _HttpClientResponse], _Errors]Retrieves an invite.
| Parameter | Type | Description |
|---|---|---|
invite_id | ||
include_response | = False |
@_t.overload
def retrieve_invite(self, invite_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveInvite200, _Errors]: ...
@_t.overload
def retrieve_invite(self, invite_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveInvite200, _HttpClientResponse], _Errors]: ...
def retrieve_invite(self, invite_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves an invite."""
return self._json(_RETRIEVE_INVITE, _c.encoded_path("/organization/invites/{}", invite_id), None, None, include_response)delete_invite#
delete_invite(invite_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteInvite200, _Errors]
delete_invite(invite_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteInvite200, _HttpClientResponse], _Errors]Delete an invite. If the invite has already been accepted, it cannot be deleted.
| Parameter | Type | Description |
|---|---|---|
invite_id | ||
include_response | = False |
@_t.overload
def delete_invite(self, invite_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteInvite200, _Errors]: ...
@_t.overload
def delete_invite(self, invite_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteInvite200, _HttpClientResponse], _Errors]: ...
def delete_invite(self, invite_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete an invite. If the invite has already been accepted, it cannot be deleted."""
return self._json(_DELETE_INVITE, _c.encoded_path("/organization/invites/{}", invite_id), None, None, include_response)list_projects#
list_projects(*, params: _T.ListProjectsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjects200, _Errors]
list_projects(*, params: _T.ListProjectsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjects200, _HttpClientResponse], _Errors]Returns a list of projects.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_projects(self, *, params: _T.ListProjectsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjects200, _Errors]: ...
@_t.overload
def list_projects(self, *, params: _T.ListProjectsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjects200, _HttpClientResponse], _Errors]: ...
def list_projects(self, *, params: _T.ListProjectsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of projects."""
return self._json(_LIST_PROJECTS, "/organization/projects", params, None, include_response)create_project#
create_project(*, payload: _T.CreateProjectRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProject200 | _T.CreateProject201, _Errors]
create_project(*, payload: _T.CreateProjectRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProject200 | _T.CreateProject201, _HttpClientResponse], _Errors]Create a new project in the organization. Projects can be created and archived, but cannot be deleted.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_project(self, *, payload: _T.CreateProjectRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProject200 | _T.CreateProject201, _Errors]: ...
@_t.overload
def create_project(self, *, payload: _T.CreateProjectRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProject200 | _T.CreateProject201, _HttpClientResponse], _Errors]: ...
def create_project(self, *, payload: _T.CreateProjectRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a new project in the organization. Projects can be created and archived, but cannot be deleted."""
return self._json(_CREATE_PROJECT, "/organization/projects", None, _c.json_body(payload), include_response)retrieve_project#
retrieve_project(project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProject200, _Errors]
retrieve_project(project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProject200, _HttpClientResponse], _Errors]Retrieves a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
include_response | = False |
@_t.overload
def retrieve_project(self, project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProject200, _Errors]: ...
@_t.overload
def retrieve_project(self, project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProject200, _HttpClientResponse], _Errors]: ...
def retrieve_project(self, project_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a project."""
return self._json(_RETRIEVE_PROJECT, _c.encoded_path("/organization/projects/{}", project_id), None, None, include_response)modify_project#
modify_project(project_id: str, *, payload: _T.ModifyProjectRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyProject200, _Errors]
modify_project(project_id: str, *, payload: _T.ModifyProjectRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyProject200, _HttpClientResponse], _Errors]Modifies a project in the organization.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_project(self, project_id: str, *, payload: _T.ModifyProjectRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyProject200, _Errors]: ...
@_t.overload
def modify_project(self, project_id: str, *, payload: _T.ModifyProjectRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyProject200, _HttpClientResponse], _Errors]: ...
def modify_project(self, project_id: str, *, payload: _T.ModifyProjectRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modifies a project in the organization."""
return self._json(_MODIFY_PROJECT, _c.encoded_path("/organization/projects/{}", project_id), None, _c.json_body(payload), include_response)list_project_api_keys#
list_project_api_keys(project_id: str, *, params: _T.ListProjectApiKeysParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectApiKeys200, _Errors]
list_project_api_keys(project_id: str, *, params: _T.ListProjectApiKeysParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectApiKeys200, _HttpClientResponse], _Errors]Returns a list of API keys in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_api_keys(self, project_id: str, *, params: _T.ListProjectApiKeysParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectApiKeys200, _Errors]: ...
@_t.overload
def list_project_api_keys(self, project_id: str, *, params: _T.ListProjectApiKeysParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectApiKeys200, _HttpClientResponse], _Errors]: ...
def list_project_api_keys(self, project_id: str, *, params: _T.ListProjectApiKeysParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of API keys in the project."""
return self._json(_LIST_PROJECT_API_KEYS, _c.encoded_path("/organization/projects/{}/api_keys", project_id), params, None, include_response)retrieve_project_api_key#
retrieve_project_api_key(project_id: str, api_key_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectApiKey200, _Errors]
retrieve_project_api_key(project_id: str, api_key_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectApiKey200, _HttpClientResponse], _Errors]Retrieves an API key in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
api_key_id | ||
include_response | = False |
@_t.overload
def retrieve_project_api_key(self, project_id: str, api_key_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectApiKey200, _Errors]: ...
@_t.overload
def retrieve_project_api_key(self, project_id: str, api_key_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectApiKey200, _HttpClientResponse], _Errors]: ...
def retrieve_project_api_key(self, project_id: str, api_key_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves an API key in the project."""
return self._json(_RETRIEVE_PROJECT_API_KEY, _c.encoded_path("/organization/projects/{}/api_keys/{}", project_id, api_key_id), None, None, include_response)delete_project_api_key#
delete_project_api_key(project_id: str, api_key_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectApiKey200, _Errors]
delete_project_api_key(project_id: str, api_key_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectApiKey200, _HttpClientResponse], _Errors]Deletes an API key from the project.
Returns confirmation of the key deletion, or an error if the key belonged to a service account.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
api_key_id | ||
include_response | = False |
@_t.overload
def delete_project_api_key(self, project_id: str, api_key_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectApiKey200, _Errors]: ...
@_t.overload
def delete_project_api_key(self, project_id: str, api_key_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectApiKey200, _HttpClientResponse], _Errors]: ...
def delete_project_api_key(self, project_id: str, api_key_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes an API key from the project.
Returns confirmation of the key deletion, or an error if the key belonged to
a service account."""
return self._json(_DELETE_PROJECT_API_KEY, _c.encoded_path("/organization/projects/{}/api_keys/{}", project_id, api_key_id), None, None, include_response)archive_project#
archive_project(project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.ArchiveProject200, _Errors]
archive_project(project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ArchiveProject200, _HttpClientResponse], _Errors]Archives a project in the organization. Archived projects cannot be used or updated.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
include_response | = False |
@_t.overload
def archive_project(self, project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.ArchiveProject200, _Errors]: ...
@_t.overload
def archive_project(self, project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ArchiveProject200, _HttpClientResponse], _Errors]: ...
def archive_project(self, project_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Archives a project in the organization. Archived projects cannot be used or updated."""
return self._json(_ARCHIVE_PROJECT, _c.encoded_path("/organization/projects/{}/archive", project_id), None, None, include_response)list_project_certificates#
list_project_certificates(project_id: str, *, params: _T.ListProjectCertificatesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectCertificates200, _Errors]
list_project_certificates(project_id: str, *, params: _T.ListProjectCertificatesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectCertificates200, _HttpClientResponse], _Errors]List certificates for this project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_certificates(self, project_id: str, *, params: _T.ListProjectCertificatesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectCertificates200, _Errors]: ...
@_t.overload
def list_project_certificates(self, project_id: str, *, params: _T.ListProjectCertificatesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectCertificates200, _HttpClientResponse], _Errors]: ...
def list_project_certificates(self, project_id: str, *, params: _T.ListProjectCertificatesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List certificates for this project."""
return self._json(_LIST_PROJECT_CERTIFICATES, _c.encoded_path("/organization/projects/{}/certificates", project_id), params, None, include_response)activate_project_certificates#
activate_project_certificates(project_id: str, *, payload: _T.ActivateProjectCertificatesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ActivateProjectCertificates200, _Errors]
activate_project_certificates(project_id: str, *, payload: _T.ActivateProjectCertificatesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ActivateProjectCertificates200, _HttpClientResponse], _Errors]Activate certificates at the project level.
You can atomically and idempotently activate up to 10 certificates at a time.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def activate_project_certificates(self, project_id: str, *, payload: _T.ActivateProjectCertificatesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ActivateProjectCertificates200, _Errors]: ...
@_t.overload
def activate_project_certificates(self, project_id: str, *, payload: _T.ActivateProjectCertificatesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ActivateProjectCertificates200, _HttpClientResponse], _Errors]: ...
def activate_project_certificates(self, project_id: str, *, payload: _T.ActivateProjectCertificatesRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Activate certificates at the project level.
You can atomically and idempotently activate up to 10 certificates at a time."""
return self._json(_ACTIVATE_PROJECT_CERTIFICATES, _c.encoded_path("/organization/projects/{}/certificates/activate", project_id), None, _c.json_body(payload), include_response)deactivate_project_certificates#
deactivate_project_certificates(project_id: str, *, payload: _T.DeactivateProjectCertificatesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.DeactivateProjectCertificates200, _Errors]
deactivate_project_certificates(project_id: str, *, payload: _T.DeactivateProjectCertificatesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeactivateProjectCertificates200, _HttpClientResponse], _Errors]Deactivate certificates at the project level. You can atomically and idempotently deactivate up to 10 certificates at a time.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def deactivate_project_certificates(self, project_id: str, *, payload: _T.DeactivateProjectCertificatesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.DeactivateProjectCertificates200, _Errors]: ...
@_t.overload
def deactivate_project_certificates(self, project_id: str, *, payload: _T.DeactivateProjectCertificatesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeactivateProjectCertificates200, _HttpClientResponse], _Errors]: ...
def deactivate_project_certificates(self, project_id: str, *, payload: _T.DeactivateProjectCertificatesRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deactivate certificates at the project level. You can atomically and
idempotently deactivate up to 10 certificates at a time."""
return self._json(_DEACTIVATE_PROJECT_CERTIFICATES, _c.encoded_path("/organization/projects/{}/certificates/deactivate", project_id), None, _c.json_body(payload), include_response)retrieve_project_data_retention#
retrieve_project_data_retention(project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectDataRetention200, _Errors]
retrieve_project_data_retention(project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectDataRetention200, _HttpClientResponse], _Errors]Retrieves project data retention controls.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
include_response | = False |
@_t.overload
def retrieve_project_data_retention(self, project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectDataRetention200, _Errors]: ...
@_t.overload
def retrieve_project_data_retention(self, project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectDataRetention200, _HttpClientResponse], _Errors]: ...
def retrieve_project_data_retention(self, project_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves project data retention controls."""
return self._json(_RETRIEVE_PROJECT_DATA_RETENTION, _c.encoded_path("/organization/projects/{}/data_retention", project_id), None, None, include_response)update_project_data_retention#
update_project_data_retention(project_id: str, *, payload: _T.UpdateProjectDataRetentionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectDataRetention200, _Errors]
update_project_data_retention(project_id: str, *, payload: _T.UpdateProjectDataRetentionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectDataRetention200, _HttpClientResponse], _Errors]Updates project data retention controls.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_project_data_retention(self, project_id: str, *, payload: _T.UpdateProjectDataRetentionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectDataRetention200, _Errors]: ...
@_t.overload
def update_project_data_retention(self, project_id: str, *, payload: _T.UpdateProjectDataRetentionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectDataRetention200, _HttpClientResponse], _Errors]: ...
def update_project_data_retention(self, project_id: str, *, payload: _T.UpdateProjectDataRetentionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates project data retention controls."""
return self._json(_UPDATE_PROJECT_DATA_RETENTION, _c.encoded_path("/organization/projects/{}/data_retention", project_id), None, _c.json_body(payload), include_response)list_project_groups#
list_project_groups(project_id: str, *, params: _T.ListProjectGroupsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectGroups200, _Errors]
list_project_groups(project_id: str, *, params: _T.ListProjectGroupsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectGroups200, _HttpClientResponse], _Errors]Lists the groups that have access to a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_groups(self, project_id: str, *, params: _T.ListProjectGroupsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectGroups200, _Errors]: ...
@_t.overload
def list_project_groups(self, project_id: str, *, params: _T.ListProjectGroupsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectGroups200, _HttpClientResponse], _Errors]: ...
def list_project_groups(self, project_id: str, *, params: _T.ListProjectGroupsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the groups that have access to a project."""
return self._json(_LIST_PROJECT_GROUPS, _c.encoded_path("/organization/projects/{}/groups", project_id), params, None, include_response)add_project_group#
add_project_group(project_id: str, *, payload: _T.AddProjectGroupRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AddProjectGroup200, _Errors]
add_project_group(project_id: str, *, payload: _T.AddProjectGroupRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AddProjectGroup200, _HttpClientResponse], _Errors]Grants a group access to a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def add_project_group(self, project_id: str, *, payload: _T.AddProjectGroupRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AddProjectGroup200, _Errors]: ...
@_t.overload
def add_project_group(self, project_id: str, *, payload: _T.AddProjectGroupRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AddProjectGroup200, _HttpClientResponse], _Errors]: ...
def add_project_group(self, project_id: str, *, payload: _T.AddProjectGroupRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Grants a group access to a project."""
return self._json(_ADD_PROJECT_GROUP, _c.encoded_path("/organization/projects/{}/groups", project_id), None, _c.json_body(payload), include_response)retrieve_project_group#
retrieve_project_group(project_id: str, group_id: str, *, params: _T.RetrieveProjectGroupParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectGroup200, _Errors]
retrieve_project_group(project_id: str, group_id: str, *, params: _T.RetrieveProjectGroupParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectGroup200, _HttpClientResponse], _Errors]Retrieves a project's group.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
group_id | ||
params | = None | |
include_response | = False |
@_t.overload
def retrieve_project_group(self, project_id: str, group_id: str, *, params: _T.RetrieveProjectGroupParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectGroup200, _Errors]: ...
@_t.overload
def retrieve_project_group(self, project_id: str, group_id: str, *, params: _T.RetrieveProjectGroupParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectGroup200, _HttpClientResponse], _Errors]: ...
def retrieve_project_group(self, project_id: str, group_id: str, *, params: _T.RetrieveProjectGroupParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a project's group."""
return self._json(_RETRIEVE_PROJECT_GROUP, _c.encoded_path("/organization/projects/{}/groups/{}", project_id, group_id), params, None, include_response)remove_project_group#
remove_project_group(project_id: str, group_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RemoveProjectGroup200, _Errors]
remove_project_group(project_id: str, group_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RemoveProjectGroup200, _HttpClientResponse], _Errors]Revokes a group's access to a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
group_id | ||
include_response | = False |
@_t.overload
def remove_project_group(self, project_id: str, group_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RemoveProjectGroup200, _Errors]: ...
@_t.overload
def remove_project_group(self, project_id: str, group_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RemoveProjectGroup200, _HttpClientResponse], _Errors]: ...
def remove_project_group(self, project_id: str, group_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Revokes a group's access to a project."""
return self._json(_REMOVE_PROJECT_GROUP, _c.encoded_path("/organization/projects/{}/groups/{}", project_id, group_id), None, None, include_response)retrieve_project_hosted_tool_permissions#
retrieve_project_hosted_tool_permissions(project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectHostedToolPermissions200, _Errors]
retrieve_project_hosted_tool_permissions(project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectHostedToolPermissions200, _HttpClientResponse], _Errors]Returns hosted tool permissions for a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
include_response | = False |
@_t.overload
def retrieve_project_hosted_tool_permissions(self, project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectHostedToolPermissions200, _Errors]: ...
@_t.overload
def retrieve_project_hosted_tool_permissions(self, project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectHostedToolPermissions200, _HttpClientResponse], _Errors]: ...
def retrieve_project_hosted_tool_permissions(self, project_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns hosted tool permissions for a project."""
return self._json(_RETRIEVE_PROJECT_HOSTED_TOOL_PERMISSIONS, _c.encoded_path("/organization/projects/{}/hosted_tool_permissions", project_id), None, None, include_response)update_project_hosted_tool_permissions#
update_project_hosted_tool_permissions(project_id: str, *, payload: _T.UpdateProjectHostedToolPermissionsRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectHostedToolPermissions200, _Errors]
update_project_hosted_tool_permissions(project_id: str, *, payload: _T.UpdateProjectHostedToolPermissionsRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectHostedToolPermissions200, _HttpClientResponse], _Errors]Updates hosted tool permissions for a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_project_hosted_tool_permissions(self, project_id: str, *, payload: _T.UpdateProjectHostedToolPermissionsRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectHostedToolPermissions200, _Errors]: ...
@_t.overload
def update_project_hosted_tool_permissions(self, project_id: str, *, payload: _T.UpdateProjectHostedToolPermissionsRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectHostedToolPermissions200, _HttpClientResponse], _Errors]: ...
def update_project_hosted_tool_permissions(self, project_id: str, *, payload: _T.UpdateProjectHostedToolPermissionsRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates hosted tool permissions for a project."""
return self._json(_UPDATE_PROJECT_HOSTED_TOOL_PERMISSIONS, _c.encoded_path("/organization/projects/{}/hosted_tool_permissions", project_id), None, _c.json_body(payload), include_response)retrieve_project_model_permissions#
retrieve_project_model_permissions(project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectModelPermissions200, _Errors]
retrieve_project_model_permissions(project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectModelPermissions200, _HttpClientResponse], _Errors]Returns model permissions for a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
include_response | = False |
@_t.overload
def retrieve_project_model_permissions(self, project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectModelPermissions200, _Errors]: ...
@_t.overload
def retrieve_project_model_permissions(self, project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectModelPermissions200, _HttpClientResponse], _Errors]: ...
def retrieve_project_model_permissions(self, project_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns model permissions for a project."""
return self._json(_RETRIEVE_PROJECT_MODEL_PERMISSIONS, _c.encoded_path("/organization/projects/{}/model_permissions", project_id), None, None, include_response)update_project_model_permissions#
update_project_model_permissions(project_id: str, *, payload: _T.UpdateProjectModelPermissionsRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectModelPermissions200, _Errors]
update_project_model_permissions(project_id: str, *, payload: _T.UpdateProjectModelPermissionsRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectModelPermissions200, _HttpClientResponse], _Errors]Updates model permissions for a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_project_model_permissions(self, project_id: str, *, payload: _T.UpdateProjectModelPermissionsRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectModelPermissions200, _Errors]: ...
@_t.overload
def update_project_model_permissions(self, project_id: str, *, payload: _T.UpdateProjectModelPermissionsRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectModelPermissions200, _HttpClientResponse], _Errors]: ...
def update_project_model_permissions(self, project_id: str, *, payload: _T.UpdateProjectModelPermissionsRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates model permissions for a project."""
return self._json(_UPDATE_PROJECT_MODEL_PERMISSIONS, _c.encoded_path("/organization/projects/{}/model_permissions", project_id), None, _c.json_body(payload), include_response)delete_project_model_permissions#
delete_project_model_permissions(project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectModelPermissions200, _Errors]
delete_project_model_permissions(project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectModelPermissions200, _HttpClientResponse], _Errors]Deletes model permissions for a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
include_response | = False |
@_t.overload
def delete_project_model_permissions(self, project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectModelPermissions200, _Errors]: ...
@_t.overload
def delete_project_model_permissions(self, project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectModelPermissions200, _HttpClientResponse], _Errors]: ...
def delete_project_model_permissions(self, project_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes model permissions for a project."""
return self._json(_DELETE_PROJECT_MODEL_PERMISSIONS, _c.encoded_path("/organization/projects/{}/model_permissions", project_id), None, None, include_response)list_project_rate_limits#
list_project_rate_limits(project_id: str, *, params: _T.ListProjectRateLimitsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectRateLimits200, _Errors]
list_project_rate_limits(project_id: str, *, params: _T.ListProjectRateLimitsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectRateLimits200, _HttpClientResponse], _Errors]Returns the rate limits per model for a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_rate_limits(self, project_id: str, *, params: _T.ListProjectRateLimitsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectRateLimits200, _Errors]: ...
@_t.overload
def list_project_rate_limits(self, project_id: str, *, params: _T.ListProjectRateLimitsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectRateLimits200, _HttpClientResponse], _Errors]: ...
def list_project_rate_limits(self, project_id: str, *, params: _T.ListProjectRateLimitsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns the rate limits per model for a project."""
return self._json(_LIST_PROJECT_RATE_LIMITS, _c.encoded_path("/organization/projects/{}/rate_limits", project_id), params, None, include_response)update_project_rate_limits#
update_project_rate_limits(project_id: str, rate_limit_id: str, *, payload: _T.UpdateProjectRateLimitsRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectRateLimits200, _Errors]
update_project_rate_limits(project_id: str, rate_limit_id: str, *, payload: _T.UpdateProjectRateLimitsRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectRateLimits200, _HttpClientResponse], _Errors]Updates a project rate limit.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
rate_limit_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_project_rate_limits(self, project_id: str, rate_limit_id: str, *, payload: _T.UpdateProjectRateLimitsRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectRateLimits200, _Errors]: ...
@_t.overload
def update_project_rate_limits(self, project_id: str, rate_limit_id: str, *, payload: _T.UpdateProjectRateLimitsRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectRateLimits200, _HttpClientResponse], _Errors]: ...
def update_project_rate_limits(self, project_id: str, rate_limit_id: str, *, payload: _T.UpdateProjectRateLimitsRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates a project rate limit."""
return self._json(_UPDATE_PROJECT_RATE_LIMITS, _c.encoded_path("/organization/projects/{}/rate_limits/{}", project_id, rate_limit_id), None, _c.json_body(payload), include_response)list_project_service_accounts#
list_project_service_accounts(project_id: str, *, params: _T.ListProjectServiceAccountsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectServiceAccounts200, _Errors]
list_project_service_accounts(project_id: str, *, params: _T.ListProjectServiceAccountsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectServiceAccounts200, _HttpClientResponse], _Errors]Returns a list of service accounts in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_service_accounts(self, project_id: str, *, params: _T.ListProjectServiceAccountsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectServiceAccounts200, _Errors]: ...
@_t.overload
def list_project_service_accounts(self, project_id: str, *, params: _T.ListProjectServiceAccountsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectServiceAccounts200, _HttpClientResponse], _Errors]: ...
def list_project_service_accounts(self, project_id: str, *, params: _T.ListProjectServiceAccountsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of service accounts in the project."""
return self._json(_LIST_PROJECT_SERVICE_ACCOUNTS, _c.encoded_path("/organization/projects/{}/service_accounts", project_id), params, None, include_response)create_project_service_account#
create_project_service_account(project_id: str, *, payload: _T.CreateProjectServiceAccountRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProjectServiceAccount200 | _T.CreateProjectServiceAccount201, _Errors]
create_project_service_account(project_id: str, *, payload: _T.CreateProjectServiceAccountRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProjectServiceAccount200 | _T.CreateProjectServiceAccount201, _HttpClientResponse], _Errors]Creates a new service account in the project. By default, this also returns an unredacted API key for the service account.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_project_service_account(self, project_id: str, *, payload: _T.CreateProjectServiceAccountRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProjectServiceAccount200 | _T.CreateProjectServiceAccount201, _Errors]: ...
@_t.overload
def create_project_service_account(self, project_id: str, *, payload: _T.CreateProjectServiceAccountRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProjectServiceAccount200 | _T.CreateProjectServiceAccount201, _HttpClientResponse], _Errors]: ...
def create_project_service_account(self, project_id: str, *, payload: _T.CreateProjectServiceAccountRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a new service account in the project. By default, this also returns an unredacted API key for the service account."""
return self._json(_CREATE_PROJECT_SERVICE_ACCOUNT, _c.encoded_path("/organization/projects/{}/service_accounts", project_id), None, _c.json_body(payload), include_response)retrieve_project_service_account#
retrieve_project_service_account(project_id: str, service_account_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectServiceAccount200, _Errors]
retrieve_project_service_account(project_id: str, service_account_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectServiceAccount200, _HttpClientResponse], _Errors]Retrieves a service account in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
service_account_id | ||
include_response | = False |
@_t.overload
def retrieve_project_service_account(self, project_id: str, service_account_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectServiceAccount200, _Errors]: ...
@_t.overload
def retrieve_project_service_account(self, project_id: str, service_account_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectServiceAccount200, _HttpClientResponse], _Errors]: ...
def retrieve_project_service_account(self, project_id: str, service_account_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a service account in the project."""
return self._json(_RETRIEVE_PROJECT_SERVICE_ACCOUNT, _c.encoded_path("/organization/projects/{}/service_accounts/{}", project_id, service_account_id), None, None, include_response)update_project_service_account#
update_project_service_account(project_id: str, service_account_id: str, *, payload: _T.UpdateProjectServiceAccountRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectServiceAccount200, _Errors]
update_project_service_account(project_id: str, service_account_id: str, *, payload: _T.UpdateProjectServiceAccountRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectServiceAccount200, _HttpClientResponse], _Errors]Updates a service account in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
service_account_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_project_service_account(self, project_id: str, service_account_id: str, *, payload: _T.UpdateProjectServiceAccountRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectServiceAccount200, _Errors]: ...
@_t.overload
def update_project_service_account(self, project_id: str, service_account_id: str, *, payload: _T.UpdateProjectServiceAccountRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectServiceAccount200, _HttpClientResponse], _Errors]: ...
def update_project_service_account(self, project_id: str, service_account_id: str, *, payload: _T.UpdateProjectServiceAccountRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates a service account in the project."""
return self._json(_UPDATE_PROJECT_SERVICE_ACCOUNT, _c.encoded_path("/organization/projects/{}/service_accounts/{}", project_id, service_account_id), None, _c.json_body(payload), include_response)delete_project_service_account#
delete_project_service_account(project_id: str, service_account_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectServiceAccount200, _Errors]
delete_project_service_account(project_id: str, service_account_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectServiceAccount200, _HttpClientResponse], _Errors]Deletes a service account from the project.
Returns confirmation of service account deletion, or an error if the project is archived (archived projects have no service accounts).
| Parameter | Type | Description |
|---|---|---|
project_id | ||
service_account_id | ||
include_response | = False |
@_t.overload
def delete_project_service_account(self, project_id: str, service_account_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectServiceAccount200, _Errors]: ...
@_t.overload
def delete_project_service_account(self, project_id: str, service_account_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectServiceAccount200, _HttpClientResponse], _Errors]: ...
def delete_project_service_account(self, project_id: str, service_account_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a service account from the project.
Returns confirmation of service account deletion, or an error if the project
is archived (archived projects have no service accounts)."""
return self._json(_DELETE_PROJECT_SERVICE_ACCOUNT, _c.encoded_path("/organization/projects/{}/service_accounts/{}", project_id, service_account_id), None, None, include_response)list_project_spend_alerts#
list_project_spend_alerts(project_id: str, *, params: _T.ListProjectSpendAlertsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectSpendAlerts200, _Errors]
list_project_spend_alerts(project_id: str, *, params: _T.ListProjectSpendAlertsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectSpendAlerts200, _HttpClientResponse], _Errors]Lists project spend alerts.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_spend_alerts(self, project_id: str, *, params: _T.ListProjectSpendAlertsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectSpendAlerts200, _Errors]: ...
@_t.overload
def list_project_spend_alerts(self, project_id: str, *, params: _T.ListProjectSpendAlertsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectSpendAlerts200, _HttpClientResponse], _Errors]: ...
def list_project_spend_alerts(self, project_id: str, *, params: _T.ListProjectSpendAlertsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists project spend alerts."""
return self._json(_LIST_PROJECT_SPEND_ALERTS, _c.encoded_path("/organization/projects/{}/spend_alerts", project_id), params, None, include_response)create_project_spend_alert#
create_project_spend_alert(project_id: str, *, payload: _T.CreateProjectSpendAlertRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProjectSpendAlert200, _Errors]
create_project_spend_alert(project_id: str, *, payload: _T.CreateProjectSpendAlertRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProjectSpendAlert200, _HttpClientResponse], _Errors]Creates a project spend alert.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_project_spend_alert(self, project_id: str, *, payload: _T.CreateProjectSpendAlertRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProjectSpendAlert200, _Errors]: ...
@_t.overload
def create_project_spend_alert(self, project_id: str, *, payload: _T.CreateProjectSpendAlertRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProjectSpendAlert200, _HttpClientResponse], _Errors]: ...
def create_project_spend_alert(self, project_id: str, *, payload: _T.CreateProjectSpendAlertRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a project spend alert."""
return self._json(_CREATE_PROJECT_SPEND_ALERT, _c.encoded_path("/organization/projects/{}/spend_alerts", project_id), None, _c.json_body(payload), include_response)retrieve_project_spend_alert#
retrieve_project_spend_alert(project_id: str, alert_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectSpendAlert200, _Errors]
retrieve_project_spend_alert(project_id: str, alert_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectSpendAlert200, _HttpClientResponse], _Errors]Retrieves a project spend alert.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
alert_id | ||
include_response | = False |
@_t.overload
def retrieve_project_spend_alert(self, project_id: str, alert_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectSpendAlert200, _Errors]: ...
@_t.overload
def retrieve_project_spend_alert(self, project_id: str, alert_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectSpendAlert200, _HttpClientResponse], _Errors]: ...
def retrieve_project_spend_alert(self, project_id: str, alert_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a project spend alert."""
return self._json(_RETRIEVE_PROJECT_SPEND_ALERT, _c.encoded_path("/organization/projects/{}/spend_alerts/{}", project_id, alert_id), None, None, include_response)update_project_spend_alert#
update_project_spend_alert(project_id: str, alert_id: str, *, payload: _T.UpdateProjectSpendAlertRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectSpendAlert200, _Errors]
update_project_spend_alert(project_id: str, alert_id: str, *, payload: _T.UpdateProjectSpendAlertRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectSpendAlert200, _HttpClientResponse], _Errors]Updates a project spend alert.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
alert_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_project_spend_alert(self, project_id: str, alert_id: str, *, payload: _T.UpdateProjectSpendAlertRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectSpendAlert200, _Errors]: ...
@_t.overload
def update_project_spend_alert(self, project_id: str, alert_id: str, *, payload: _T.UpdateProjectSpendAlertRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectSpendAlert200, _HttpClientResponse], _Errors]: ...
def update_project_spend_alert(self, project_id: str, alert_id: str, *, payload: _T.UpdateProjectSpendAlertRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates a project spend alert."""
return self._json(_UPDATE_PROJECT_SPEND_ALERT, _c.encoded_path("/organization/projects/{}/spend_alerts/{}", project_id, alert_id), None, _c.json_body(payload), include_response)delete_project_spend_alert#
delete_project_spend_alert(project_id: str, alert_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectSpendAlert200, _Errors]
delete_project_spend_alert(project_id: str, alert_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectSpendAlert200, _HttpClientResponse], _Errors]Deletes a project spend alert.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
alert_id | ||
include_response | = False |
@_t.overload
def delete_project_spend_alert(self, project_id: str, alert_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectSpendAlert200, _Errors]: ...
@_t.overload
def delete_project_spend_alert(self, project_id: str, alert_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectSpendAlert200, _HttpClientResponse], _Errors]: ...
def delete_project_spend_alert(self, project_id: str, alert_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a project spend alert."""
return self._json(_DELETE_PROJECT_SPEND_ALERT, _c.encoded_path("/organization/projects/{}/spend_alerts/{}", project_id, alert_id), None, None, include_response)list_project_users#
list_project_users(project_id: str, *, params: _T.ListProjectUsersParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectUsers200, _Errors]
list_project_users(project_id: str, *, params: _T.ListProjectUsersParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectUsers200, _HttpClientResponse], _Errors]Returns a list of users in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_users(self, project_id: str, *, params: _T.ListProjectUsersParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectUsers200, _Errors]: ...
@_t.overload
def list_project_users(self, project_id: str, *, params: _T.ListProjectUsersParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectUsers200, _HttpClientResponse], _Errors]: ...
def list_project_users(self, project_id: str, *, params: _T.ListProjectUsersParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of users in the project."""
return self._json(_LIST_PROJECT_USERS, _c.encoded_path("/organization/projects/{}/users", project_id), params, None, include_response)create_project_user#
create_project_user(project_id: str, *, payload: _T.CreateProjectUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProjectUser200 | _T.CreateProjectUser201, _Errors]
create_project_user(project_id: str, *, payload: _T.CreateProjectUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProjectUser200 | _T.CreateProjectUser201, _HttpClientResponse], _Errors]Adds a user to the project. Users must already be members of the organization to be added to a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_project_user(self, project_id: str, *, payload: _T.CreateProjectUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProjectUser200 | _T.CreateProjectUser201, _Errors]: ...
@_t.overload
def create_project_user(self, project_id: str, *, payload: _T.CreateProjectUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProjectUser200 | _T.CreateProjectUser201, _HttpClientResponse], _Errors]: ...
def create_project_user(self, project_id: str, *, payload: _T.CreateProjectUserRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Adds a user to the project. Users must already be members of the organization to be added to a project."""
return self._json(_CREATE_PROJECT_USER, _c.encoded_path("/organization/projects/{}/users", project_id), None, _c.json_body(payload), include_response)retrieve_project_user#
retrieve_project_user(project_id: str, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectUser200, _Errors]
retrieve_project_user(project_id: str, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectUser200, _HttpClientResponse], _Errors]Retrieves a user in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
user_id | ||
include_response | = False |
@_t.overload
def retrieve_project_user(self, project_id: str, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectUser200, _Errors]: ...
@_t.overload
def retrieve_project_user(self, project_id: str, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectUser200, _HttpClientResponse], _Errors]: ...
def retrieve_project_user(self, project_id: str, user_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a user in the project."""
return self._json(_RETRIEVE_PROJECT_USER, _c.encoded_path("/organization/projects/{}/users/{}", project_id, user_id), None, None, include_response)modify_project_user#
modify_project_user(project_id: str, user_id: str, *, payload: _T.ModifyProjectUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyProjectUser200, _Errors]
modify_project_user(project_id: str, user_id: str, *, payload: _T.ModifyProjectUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyProjectUser200, _HttpClientResponse], _Errors]Modifies a user's role in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
user_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_project_user(self, project_id: str, user_id: str, *, payload: _T.ModifyProjectUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyProjectUser200, _Errors]: ...
@_t.overload
def modify_project_user(self, project_id: str, user_id: str, *, payload: _T.ModifyProjectUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyProjectUser200, _HttpClientResponse], _Errors]: ...
def modify_project_user(self, project_id: str, user_id: str, *, payload: _T.ModifyProjectUserRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modifies a user's role in the project."""
return self._json(_MODIFY_PROJECT_USER, _c.encoded_path("/organization/projects/{}/users/{}", project_id, user_id), None, _c.json_body(payload), include_response)delete_project_user#
delete_project_user(project_id: str, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectUser200, _Errors]
delete_project_user(project_id: str, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectUser200, _HttpClientResponse], _Errors]Deletes a user from the project.
Returns confirmation of project user deletion, or an error if the project is archived (archived projects have no users).
| Parameter | Type | Description |
|---|---|---|
project_id | ||
user_id | ||
include_response | = False |
@_t.overload
def delete_project_user(self, project_id: str, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectUser200, _Errors]: ...
@_t.overload
def delete_project_user(self, project_id: str, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectUser200, _HttpClientResponse], _Errors]: ...
def delete_project_user(self, project_id: str, user_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a user from the project.
Returns confirmation of project user deletion, or an error if the project is
archived (archived projects have no users)."""
return self._json(_DELETE_PROJECT_USER, _c.encoded_path("/organization/projects/{}/users/{}", project_id, user_id), None, None, include_response)list_roles#
list_roles(*, params: _T.ListRolesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListRoles200, _Errors]
list_roles(*, params: _T.ListRolesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListRoles200, _HttpClientResponse], _Errors]Lists the roles configured for the organization.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_roles(self, *, params: _T.ListRolesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListRoles200, _Errors]: ...
@_t.overload
def list_roles(self, *, params: _T.ListRolesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListRoles200, _HttpClientResponse], _Errors]: ...
def list_roles(self, *, params: _T.ListRolesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the roles configured for the organization."""
return self._json(_LIST_ROLES, "/organization/roles", params, None, include_response)create_role#
create_role(*, payload: _T.CreateRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRole200, _Errors]
create_role(*, payload: _T.CreateRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRole200, _HttpClientResponse], _Errors]Creates a custom role for the organization.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_role(self, *, payload: _T.CreateRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRole200, _Errors]: ...
@_t.overload
def create_role(self, *, payload: _T.CreateRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRole200, _HttpClientResponse], _Errors]: ...
def create_role(self, *, payload: _T.CreateRoleRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a custom role for the organization."""
return self._json(_CREATE_ROLE, "/organization/roles", None, _c.json_body(payload), include_response)retrieve_role#
retrieve_role(role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveRole200, _Errors]
retrieve_role(role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveRole200, _HttpClientResponse], _Errors]Retrieves an organization role.
| Parameter | Type | Description |
|---|---|---|
role_id | ||
include_response | = False |
@_t.overload
def retrieve_role(self, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveRole200, _Errors]: ...
@_t.overload
def retrieve_role(self, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveRole200, _HttpClientResponse], _Errors]: ...
def retrieve_role(self, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves an organization role."""
return self._json(_RETRIEVE_ROLE, _c.encoded_path("/organization/roles/{}", role_id), None, None, include_response)update_role#
update_role(role_id: str, *, payload: _T.UpdateRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateRole200, _Errors]
update_role(role_id: str, *, payload: _T.UpdateRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateRole200, _HttpClientResponse], _Errors]Updates an existing organization role.
| Parameter | Type | Description |
|---|---|---|
role_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_role(self, role_id: str, *, payload: _T.UpdateRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateRole200, _Errors]: ...
@_t.overload
def update_role(self, role_id: str, *, payload: _T.UpdateRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateRole200, _HttpClientResponse], _Errors]: ...
def update_role(self, role_id: str, *, payload: _T.UpdateRoleRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates an existing organization role."""
return self._json(_UPDATE_ROLE, _c.encoded_path("/organization/roles/{}", role_id), None, _c.json_body(payload), include_response)delete_role#
delete_role(role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteRole200, _Errors]
delete_role(role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteRole200, _HttpClientResponse], _Errors]Deletes a custom role from the organization.
| Parameter | Type | Description |
|---|---|---|
role_id | ||
include_response | = False |
@_t.overload
def delete_role(self, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteRole200, _Errors]: ...
@_t.overload
def delete_role(self, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteRole200, _HttpClientResponse], _Errors]: ...
def delete_role(self, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a custom role from the organization."""
return self._json(_DELETE_ROLE, _c.encoded_path("/organization/roles/{}", role_id), None, None, include_response)list_organization_spend_alerts#
list_organization_spend_alerts(*, params: _T.ListOrganizationSpendAlertsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListOrganizationSpendAlerts200, _Errors]
list_organization_spend_alerts(*, params: _T.ListOrganizationSpendAlertsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListOrganizationSpendAlerts200, _HttpClientResponse], _Errors]Lists organization spend alerts.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_organization_spend_alerts(self, *, params: _T.ListOrganizationSpendAlertsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListOrganizationSpendAlerts200, _Errors]: ...
@_t.overload
def list_organization_spend_alerts(self, *, params: _T.ListOrganizationSpendAlertsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListOrganizationSpendAlerts200, _HttpClientResponse], _Errors]: ...
def list_organization_spend_alerts(self, *, params: _T.ListOrganizationSpendAlertsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists organization spend alerts."""
return self._json(_LIST_ORGANIZATION_SPEND_ALERTS, "/organization/spend_alerts", params, None, include_response)create_organization_spend_alert#
create_organization_spend_alert(*, payload: _T.CreateOrganizationSpendAlertRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateOrganizationSpendAlert200, _Errors]
create_organization_spend_alert(*, payload: _T.CreateOrganizationSpendAlertRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateOrganizationSpendAlert200, _HttpClientResponse], _Errors]Creates an organization spend alert.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_organization_spend_alert(self, *, payload: _T.CreateOrganizationSpendAlertRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateOrganizationSpendAlert200, _Errors]: ...
@_t.overload
def create_organization_spend_alert(self, *, payload: _T.CreateOrganizationSpendAlertRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateOrganizationSpendAlert200, _HttpClientResponse], _Errors]: ...
def create_organization_spend_alert(self, *, payload: _T.CreateOrganizationSpendAlertRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates an organization spend alert."""
return self._json(_CREATE_ORGANIZATION_SPEND_ALERT, "/organization/spend_alerts", None, _c.json_body(payload), include_response)retrieve_organization_spend_alert#
retrieve_organization_spend_alert(alert_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveOrganizationSpendAlert200, _Errors]
retrieve_organization_spend_alert(alert_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveOrganizationSpendAlert200, _HttpClientResponse], _Errors]Retrieves an organization spend alert.
| Parameter | Type | Description |
|---|---|---|
alert_id | ||
include_response | = False |
@_t.overload
def retrieve_organization_spend_alert(self, alert_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveOrganizationSpendAlert200, _Errors]: ...
@_t.overload
def retrieve_organization_spend_alert(self, alert_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveOrganizationSpendAlert200, _HttpClientResponse], _Errors]: ...
def retrieve_organization_spend_alert(self, alert_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves an organization spend alert."""
return self._json(_RETRIEVE_ORGANIZATION_SPEND_ALERT, _c.encoded_path("/organization/spend_alerts/{}", alert_id), None, None, include_response)update_organization_spend_alert#
update_organization_spend_alert(alert_id: str, *, payload: _T.UpdateOrganizationSpendAlertRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateOrganizationSpendAlert200, _Errors]
update_organization_spend_alert(alert_id: str, *, payload: _T.UpdateOrganizationSpendAlertRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateOrganizationSpendAlert200, _HttpClientResponse], _Errors]Updates an organization spend alert.
| Parameter | Type | Description |
|---|---|---|
alert_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_organization_spend_alert(self, alert_id: str, *, payload: _T.UpdateOrganizationSpendAlertRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateOrganizationSpendAlert200, _Errors]: ...
@_t.overload
def update_organization_spend_alert(self, alert_id: str, *, payload: _T.UpdateOrganizationSpendAlertRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateOrganizationSpendAlert200, _HttpClientResponse], _Errors]: ...
def update_organization_spend_alert(self, alert_id: str, *, payload: _T.UpdateOrganizationSpendAlertRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates an organization spend alert."""
return self._json(_UPDATE_ORGANIZATION_SPEND_ALERT, _c.encoded_path("/organization/spend_alerts/{}", alert_id), None, _c.json_body(payload), include_response)delete_organization_spend_alert#
delete_organization_spend_alert(alert_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteOrganizationSpendAlert200, _Errors]
delete_organization_spend_alert(alert_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteOrganizationSpendAlert200, _HttpClientResponse], _Errors]Deletes an organization spend alert.
| Parameter | Type | Description |
|---|---|---|
alert_id | ||
include_response | = False |
@_t.overload
def delete_organization_spend_alert(self, alert_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteOrganizationSpendAlert200, _Errors]: ...
@_t.overload
def delete_organization_spend_alert(self, alert_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteOrganizationSpendAlert200, _HttpClientResponse], _Errors]: ...
def delete_organization_spend_alert(self, alert_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes an organization spend alert."""
return self._json(_DELETE_ORGANIZATION_SPEND_ALERT, _c.encoded_path("/organization/spend_alerts/{}", alert_id), None, None, include_response)usage_audio_speeches#
usage_audio_speeches(*, params: _T.UsageAudioSpeechesParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageAudioSpeeches200, _Errors]
usage_audio_speeches(*, params: _T.UsageAudioSpeechesParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageAudioSpeeches200, _HttpClientResponse], _Errors]Get audio speeches usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_audio_speeches(self, *, params: _T.UsageAudioSpeechesParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageAudioSpeeches200, _Errors]: ...
@_t.overload
def usage_audio_speeches(self, *, params: _T.UsageAudioSpeechesParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageAudioSpeeches200, _HttpClientResponse], _Errors]: ...
def usage_audio_speeches(self, *, params: _T.UsageAudioSpeechesParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get audio speeches usage details for the organization."""
return self._json(_USAGE_AUDIO_SPEECHES, "/organization/usage/audio_speeches", params, None, include_response)usage_audio_transcriptions#
usage_audio_transcriptions(*, params: _T.UsageAudioTranscriptionsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageAudioTranscriptions200, _Errors]
usage_audio_transcriptions(*, params: _T.UsageAudioTranscriptionsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageAudioTranscriptions200, _HttpClientResponse], _Errors]Get audio transcriptions usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_audio_transcriptions(self, *, params: _T.UsageAudioTranscriptionsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageAudioTranscriptions200, _Errors]: ...
@_t.overload
def usage_audio_transcriptions(self, *, params: _T.UsageAudioTranscriptionsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageAudioTranscriptions200, _HttpClientResponse], _Errors]: ...
def usage_audio_transcriptions(self, *, params: _T.UsageAudioTranscriptionsParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get audio transcriptions usage details for the organization."""
return self._json(_USAGE_AUDIO_TRANSCRIPTIONS, "/organization/usage/audio_transcriptions", params, None, include_response)usage_code_interpreter_sessions#
usage_code_interpreter_sessions(*, params: _T.UsageCodeInterpreterSessionsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageCodeInterpreterSessions200, _Errors]
usage_code_interpreter_sessions(*, params: _T.UsageCodeInterpreterSessionsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageCodeInterpreterSessions200, _HttpClientResponse], _Errors]Get code interpreter sessions usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_code_interpreter_sessions(self, *, params: _T.UsageCodeInterpreterSessionsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageCodeInterpreterSessions200, _Errors]: ...
@_t.overload
def usage_code_interpreter_sessions(self, *, params: _T.UsageCodeInterpreterSessionsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageCodeInterpreterSessions200, _HttpClientResponse], _Errors]: ...
def usage_code_interpreter_sessions(self, *, params: _T.UsageCodeInterpreterSessionsParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get code interpreter sessions usage details for the organization."""
return self._json(_USAGE_CODE_INTERPRETER_SESSIONS, "/organization/usage/code_interpreter_sessions", params, None, include_response)usage_completions#
usage_completions(*, params: _T.UsageCompletionsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageCompletions200, _Errors]
usage_completions(*, params: _T.UsageCompletionsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageCompletions200, _HttpClientResponse], _Errors]Get completions usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_completions(self, *, params: _T.UsageCompletionsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageCompletions200, _Errors]: ...
@_t.overload
def usage_completions(self, *, params: _T.UsageCompletionsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageCompletions200, _HttpClientResponse], _Errors]: ...
def usage_completions(self, *, params: _T.UsageCompletionsParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get completions usage details for the organization."""
return self._json(_USAGE_COMPLETIONS, "/organization/usage/completions", params, None, include_response)usage_embeddings#
usage_embeddings(*, params: _T.UsageEmbeddingsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageEmbeddings200, _Errors]
usage_embeddings(*, params: _T.UsageEmbeddingsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageEmbeddings200, _HttpClientResponse], _Errors]Get embeddings usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_embeddings(self, *, params: _T.UsageEmbeddingsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageEmbeddings200, _Errors]: ...
@_t.overload
def usage_embeddings(self, *, params: _T.UsageEmbeddingsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageEmbeddings200, _HttpClientResponse], _Errors]: ...
def usage_embeddings(self, *, params: _T.UsageEmbeddingsParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get embeddings usage details for the organization."""
return self._json(_USAGE_EMBEDDINGS, "/organization/usage/embeddings", params, None, include_response)usage_file_search_calls#
usage_file_search_calls(*, params: _T.UsageFileSearchCallsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageFileSearchCalls200, _Errors]
usage_file_search_calls(*, params: _T.UsageFileSearchCallsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageFileSearchCalls200, _HttpClientResponse], _Errors]Get file search calls usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_file_search_calls(self, *, params: _T.UsageFileSearchCallsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageFileSearchCalls200, _Errors]: ...
@_t.overload
def usage_file_search_calls(self, *, params: _T.UsageFileSearchCallsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageFileSearchCalls200, _HttpClientResponse], _Errors]: ...
def usage_file_search_calls(self, *, params: _T.UsageFileSearchCallsParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get file search calls usage details for the organization."""
return self._json(_USAGE_FILE_SEARCH_CALLS, "/organization/usage/file_search_calls", params, None, include_response)usage_images#
usage_images(*, params: _T.UsageImagesParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageImages200, _Errors]
usage_images(*, params: _T.UsageImagesParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageImages200, _HttpClientResponse], _Errors]Get images usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_images(self, *, params: _T.UsageImagesParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageImages200, _Errors]: ...
@_t.overload
def usage_images(self, *, params: _T.UsageImagesParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageImages200, _HttpClientResponse], _Errors]: ...
def usage_images(self, *, params: _T.UsageImagesParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get images usage details for the organization."""
return self._json(_USAGE_IMAGES, "/organization/usage/images", params, None, include_response)usage_moderations#
usage_moderations(*, params: _T.UsageModerationsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageModerations200, _Errors]
usage_moderations(*, params: _T.UsageModerationsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageModerations200, _HttpClientResponse], _Errors]Get moderations usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_moderations(self, *, params: _T.UsageModerationsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageModerations200, _Errors]: ...
@_t.overload
def usage_moderations(self, *, params: _T.UsageModerationsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageModerations200, _HttpClientResponse], _Errors]: ...
def usage_moderations(self, *, params: _T.UsageModerationsParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get moderations usage details for the organization."""
return self._json(_USAGE_MODERATIONS, "/organization/usage/moderations", params, None, include_response)usage_vector_stores#
usage_vector_stores(*, params: _T.UsageVectorStoresParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageVectorStores200, _Errors]
usage_vector_stores(*, params: _T.UsageVectorStoresParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageVectorStores200, _HttpClientResponse], _Errors]Get vector stores usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_vector_stores(self, *, params: _T.UsageVectorStoresParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageVectorStores200, _Errors]: ...
@_t.overload
def usage_vector_stores(self, *, params: _T.UsageVectorStoresParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageVectorStores200, _HttpClientResponse], _Errors]: ...
def usage_vector_stores(self, *, params: _T.UsageVectorStoresParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get vector stores usage details for the organization."""
return self._json(_USAGE_VECTOR_STORES, "/organization/usage/vector_stores", params, None, include_response)usage_web_search_calls#
usage_web_search_calls(*, params: _T.UsageWebSearchCallsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageWebSearchCalls200, _Errors]
usage_web_search_calls(*, params: _T.UsageWebSearchCallsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageWebSearchCalls200, _HttpClientResponse], _Errors]Get web search calls usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def usage_web_search_calls(self, *, params: _T.UsageWebSearchCallsParams, include_response: _t.Literal[False] = False) -> _Effect[_T.UsageWebSearchCalls200, _Errors]: ...
@_t.overload
def usage_web_search_calls(self, *, params: _T.UsageWebSearchCallsParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UsageWebSearchCalls200, _HttpClientResponse], _Errors]: ...
def usage_web_search_calls(self, *, params: _T.UsageWebSearchCallsParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get web search calls usage details for the organization."""
return self._json(_USAGE_WEB_SEARCH_CALLS, "/organization/usage/web_search_calls", params, None, include_response)list_users#
list_users(*, params: _T.ListUsersParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListUsers200, _Errors]
list_users(*, params: _T.ListUsersParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListUsers200, _HttpClientResponse], _Errors]Lists all of the users in the organization.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_users(self, *, params: _T.ListUsersParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListUsers200, _Errors]: ...
@_t.overload
def list_users(self, *, params: _T.ListUsersParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListUsers200, _HttpClientResponse], _Errors]: ...
def list_users(self, *, params: _T.ListUsersParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists all of the users in the organization."""
return self._json(_LIST_USERS, "/organization/users", params, None, include_response)retrieve_user#
retrieve_user(user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveUser200, _Errors]
retrieve_user(user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveUser200, _HttpClientResponse], _Errors]Retrieves a user by their identifier.
| Parameter | Type | Description |
|---|---|---|
user_id | ||
include_response | = False |
@_t.overload
def retrieve_user(self, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveUser200, _Errors]: ...
@_t.overload
def retrieve_user(self, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveUser200, _HttpClientResponse], _Errors]: ...
def retrieve_user(self, user_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a user by their identifier."""
return self._json(_RETRIEVE_USER, _c.encoded_path("/organization/users/{}", user_id), None, None, include_response)modify_user#
modify_user(user_id: str, *, payload: _T.ModifyUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyUser200, _Errors]
modify_user(user_id: str, *, payload: _T.ModifyUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyUser200, _HttpClientResponse], _Errors]Modifies a user's role in the organization.
| Parameter | Type | Description |
|---|---|---|
user_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_user(self, user_id: str, *, payload: _T.ModifyUserRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyUser200, _Errors]: ...
@_t.overload
def modify_user(self, user_id: str, *, payload: _T.ModifyUserRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyUser200, _HttpClientResponse], _Errors]: ...
def modify_user(self, user_id: str, *, payload: _T.ModifyUserRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modifies a user's role in the organization."""
return self._json(_MODIFY_USER, _c.encoded_path("/organization/users/{}", user_id), None, _c.json_body(payload), include_response)delete_user#
delete_user(user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteUser200, _Errors]
delete_user(user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteUser200, _HttpClientResponse], _Errors]Deletes a user from the organization.
| Parameter | Type | Description |
|---|---|---|
user_id | ||
include_response | = False |
@_t.overload
def delete_user(self, user_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteUser200, _Errors]: ...
@_t.overload
def delete_user(self, user_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteUser200, _HttpClientResponse], _Errors]: ...
def delete_user(self, user_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a user from the organization."""
return self._json(_DELETE_USER, _c.encoded_path("/organization/users/{}", user_id), None, None, include_response)list_user_role_assignments#
list_user_role_assignments(user_id: str, *, params: _T.ListUserRoleAssignmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListUserRoleAssignments200, _Errors]
list_user_role_assignments(user_id: str, *, params: _T.ListUserRoleAssignmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListUserRoleAssignments200, _HttpClientResponse], _Errors]Lists the organization roles assigned to a user within the organization.
| Parameter | Type | Description |
|---|---|---|
user_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_user_role_assignments(self, user_id: str, *, params: _T.ListUserRoleAssignmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListUserRoleAssignments200, _Errors]: ...
@_t.overload
def list_user_role_assignments(self, user_id: str, *, params: _T.ListUserRoleAssignmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListUserRoleAssignments200, _HttpClientResponse], _Errors]: ...
def list_user_role_assignments(self, user_id: str, *, params: _T.ListUserRoleAssignmentsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the organization roles assigned to a user within the organization."""
return self._json(_LIST_USER_ROLE_ASSIGNMENTS, _c.encoded_path("/organization/users/{}/roles", user_id), params, None, include_response)assign_user_role#
assign_user_role(user_id: str, *, payload: _T.AssignUserRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AssignUserRole200, _Errors]
assign_user_role(user_id: str, *, payload: _T.AssignUserRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AssignUserRole200, _HttpClientResponse], _Errors]Assigns an organization role to a user within the organization.
| Parameter | Type | Description |
|---|---|---|
user_id | ||
payload | ||
include_response | = False |
@_t.overload
def assign_user_role(self, user_id: str, *, payload: _T.AssignUserRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AssignUserRole200, _Errors]: ...
@_t.overload
def assign_user_role(self, user_id: str, *, payload: _T.AssignUserRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AssignUserRole200, _HttpClientResponse], _Errors]: ...
def assign_user_role(self, user_id: str, *, payload: _T.AssignUserRoleRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Assigns an organization role to a user within the organization."""
return self._json(_ASSIGN_USER_ROLE, _c.encoded_path("/organization/users/{}/roles", user_id), None, _c.json_body(payload), include_response)retrieve_user_role#
retrieve_user_role(user_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveUserRole200, _Errors]
retrieve_user_role(user_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveUserRole200, _HttpClientResponse], _Errors]Retrieves an organization role assigned to a user.
| Parameter | Type | Description |
|---|---|---|
user_id | ||
role_id | ||
include_response | = False |
@_t.overload
def retrieve_user_role(self, user_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveUserRole200, _Errors]: ...
@_t.overload
def retrieve_user_role(self, user_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveUserRole200, _HttpClientResponse], _Errors]: ...
def retrieve_user_role(self, user_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves an organization role assigned to a user."""
return self._json(_RETRIEVE_USER_ROLE, _c.encoded_path("/organization/users/{}/roles/{}", user_id, role_id), None, None, include_response)unassign_user_role#
unassign_user_role(user_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.UnassignUserRole200, _Errors]
unassign_user_role(user_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UnassignUserRole200, _HttpClientResponse], _Errors]Unassigns an organization role from a user within the organization.
| Parameter | Type | Description |
|---|---|---|
user_id | ||
role_id | ||
include_response | = False |
@_t.overload
def unassign_user_role(self, user_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.UnassignUserRole200, _Errors]: ...
@_t.overload
def unassign_user_role(self, user_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UnassignUserRole200, _HttpClientResponse], _Errors]: ...
def unassign_user_role(self, user_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Unassigns an organization role from a user within the organization."""
return self._json(_UNASSIGN_USER_ROLE, _c.encoded_path("/organization/users/{}/roles/{}", user_id, role_id), None, None, include_response)list_project_group_role_assignments#
list_project_group_role_assignments(project_id: str, group_id: str, *, params: _T.ListProjectGroupRoleAssignmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectGroupRoleAssignments200, _Errors]
list_project_group_role_assignments(project_id: str, group_id: str, *, params: _T.ListProjectGroupRoleAssignmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectGroupRoleAssignments200, _HttpClientResponse], _Errors]Lists the project roles assigned to a group within a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
group_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_group_role_assignments(self, project_id: str, group_id: str, *, params: _T.ListProjectGroupRoleAssignmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectGroupRoleAssignments200, _Errors]: ...
@_t.overload
def list_project_group_role_assignments(self, project_id: str, group_id: str, *, params: _T.ListProjectGroupRoleAssignmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectGroupRoleAssignments200, _HttpClientResponse], _Errors]: ...
def list_project_group_role_assignments(self, project_id: str, group_id: str, *, params: _T.ListProjectGroupRoleAssignmentsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the project roles assigned to a group within a project."""
return self._json(_LIST_PROJECT_GROUP_ROLE_ASSIGNMENTS, _c.encoded_path("/projects/{}/groups/{}/roles", project_id, group_id), params, None, include_response)assign_project_group_role#
assign_project_group_role(project_id: str, group_id: str, *, payload: _T.AssignProjectGroupRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AssignProjectGroupRole200, _Errors]
assign_project_group_role(project_id: str, group_id: str, *, payload: _T.AssignProjectGroupRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AssignProjectGroupRole200, _HttpClientResponse], _Errors]Assigns a project role to a group within a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
group_id | ||
payload | ||
include_response | = False |
@_t.overload
def assign_project_group_role(self, project_id: str, group_id: str, *, payload: _T.AssignProjectGroupRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AssignProjectGroupRole200, _Errors]: ...
@_t.overload
def assign_project_group_role(self, project_id: str, group_id: str, *, payload: _T.AssignProjectGroupRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AssignProjectGroupRole200, _HttpClientResponse], _Errors]: ...
def assign_project_group_role(self, project_id: str, group_id: str, *, payload: _T.AssignProjectGroupRoleRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Assigns a project role to a group within a project."""
return self._json(_ASSIGN_PROJECT_GROUP_ROLE, _c.encoded_path("/projects/{}/groups/{}/roles", project_id, group_id), None, _c.json_body(payload), include_response)retrieve_project_group_role#
retrieve_project_group_role(project_id: str, group_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectGroupRole200, _Errors]
retrieve_project_group_role(project_id: str, group_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectGroupRole200, _HttpClientResponse], _Errors]Retrieves a project role assigned to a group.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
group_id | ||
role_id | ||
include_response | = False |
@_t.overload
def retrieve_project_group_role(self, project_id: str, group_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectGroupRole200, _Errors]: ...
@_t.overload
def retrieve_project_group_role(self, project_id: str, group_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectGroupRole200, _HttpClientResponse], _Errors]: ...
def retrieve_project_group_role(self, project_id: str, group_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a project role assigned to a group."""
return self._json(_RETRIEVE_PROJECT_GROUP_ROLE, _c.encoded_path("/projects/{}/groups/{}/roles/{}", project_id, group_id, role_id), None, None, include_response)unassign_project_group_role#
unassign_project_group_role(project_id: str, group_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.UnassignProjectGroupRole200, _Errors]
unassign_project_group_role(project_id: str, group_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UnassignProjectGroupRole200, _HttpClientResponse], _Errors]Unassigns a project role from a group within a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
group_id | ||
role_id | ||
include_response | = False |
@_t.overload
def unassign_project_group_role(self, project_id: str, group_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.UnassignProjectGroupRole200, _Errors]: ...
@_t.overload
def unassign_project_group_role(self, project_id: str, group_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UnassignProjectGroupRole200, _HttpClientResponse], _Errors]: ...
def unassign_project_group_role(self, project_id: str, group_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Unassigns a project role from a group within a project."""
return self._json(_UNASSIGN_PROJECT_GROUP_ROLE, _c.encoded_path("/projects/{}/groups/{}/roles/{}", project_id, group_id, role_id), None, None, include_response)list_project_roles#
list_project_roles(project_id: str, *, params: _T.ListProjectRolesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectRoles200, _Errors]
list_project_roles(project_id: str, *, params: _T.ListProjectRolesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectRoles200, _HttpClientResponse], _Errors]Lists the roles configured for a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_roles(self, project_id: str, *, params: _T.ListProjectRolesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectRoles200, _Errors]: ...
@_t.overload
def list_project_roles(self, project_id: str, *, params: _T.ListProjectRolesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectRoles200, _HttpClientResponse], _Errors]: ...
def list_project_roles(self, project_id: str, *, params: _T.ListProjectRolesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the roles configured for a project."""
return self._json(_LIST_PROJECT_ROLES, _c.encoded_path("/projects/{}/roles", project_id), params, None, include_response)create_project_role#
create_project_role(project_id: str, *, payload: _T.CreateProjectRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProjectRole200, _Errors]
create_project_role(project_id: str, *, payload: _T.CreateProjectRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProjectRole200, _HttpClientResponse], _Errors]Creates a custom role for a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_project_role(self, project_id: str, *, payload: _T.CreateProjectRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateProjectRole200, _Errors]: ...
@_t.overload
def create_project_role(self, project_id: str, *, payload: _T.CreateProjectRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateProjectRole200, _HttpClientResponse], _Errors]: ...
def create_project_role(self, project_id: str, *, payload: _T.CreateProjectRoleRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a custom role for a project."""
return self._json(_CREATE_PROJECT_ROLE, _c.encoded_path("/projects/{}/roles", project_id), None, _c.json_body(payload), include_response)retrieve_project_role#
retrieve_project_role(project_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectRole200, _Errors]
retrieve_project_role(project_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectRole200, _HttpClientResponse], _Errors]Retrieves a project role.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
role_id | ||
include_response | = False |
@_t.overload
def retrieve_project_role(self, project_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectRole200, _Errors]: ...
@_t.overload
def retrieve_project_role(self, project_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectRole200, _HttpClientResponse], _Errors]: ...
def retrieve_project_role(self, project_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a project role."""
return self._json(_RETRIEVE_PROJECT_ROLE, _c.encoded_path("/projects/{}/roles/{}", project_id, role_id), None, None, include_response)update_project_role#
update_project_role(project_id: str, role_id: str, *, payload: _T.UpdateProjectRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectRole200, _Errors]
update_project_role(project_id: str, role_id: str, *, payload: _T.UpdateProjectRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectRole200, _HttpClientResponse], _Errors]Updates an existing project role.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
role_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_project_role(self, project_id: str, role_id: str, *, payload: _T.UpdateProjectRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateProjectRole200, _Errors]: ...
@_t.overload
def update_project_role(self, project_id: str, role_id: str, *, payload: _T.UpdateProjectRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateProjectRole200, _HttpClientResponse], _Errors]: ...
def update_project_role(self, project_id: str, role_id: str, *, payload: _T.UpdateProjectRoleRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates an existing project role."""
return self._json(_UPDATE_PROJECT_ROLE, _c.encoded_path("/projects/{}/roles/{}", project_id, role_id), None, _c.json_body(payload), include_response)delete_project_role#
delete_project_role(project_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectRole200, _Errors]
delete_project_role(project_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectRole200, _HttpClientResponse], _Errors]Deletes a custom role from a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
role_id | ||
include_response | = False |
@_t.overload
def delete_project_role(self, project_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteProjectRole200, _Errors]: ...
@_t.overload
def delete_project_role(self, project_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteProjectRole200, _HttpClientResponse], _Errors]: ...
def delete_project_role(self, project_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a custom role from a project."""
return self._json(_DELETE_PROJECT_ROLE, _c.encoded_path("/projects/{}/roles/{}", project_id, role_id), None, None, include_response)list_project_user_role_assignments#
list_project_user_role_assignments(project_id: str, user_id: str, *, params: _T.ListProjectUserRoleAssignmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectUserRoleAssignments200, _Errors]
list_project_user_role_assignments(project_id: str, user_id: str, *, params: _T.ListProjectUserRoleAssignmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectUserRoleAssignments200, _HttpClientResponse], _Errors]Lists the project roles assigned to a user within a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
user_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_project_user_role_assignments(self, project_id: str, user_id: str, *, params: _T.ListProjectUserRoleAssignmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListProjectUserRoleAssignments200, _Errors]: ...
@_t.overload
def list_project_user_role_assignments(self, project_id: str, user_id: str, *, params: _T.ListProjectUserRoleAssignmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListProjectUserRoleAssignments200, _HttpClientResponse], _Errors]: ...
def list_project_user_role_assignments(self, project_id: str, user_id: str, *, params: _T.ListProjectUserRoleAssignmentsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists the project roles assigned to a user within a project."""
return self._json(_LIST_PROJECT_USER_ROLE_ASSIGNMENTS, _c.encoded_path("/projects/{}/users/{}/roles", project_id, user_id), params, None, include_response)assign_project_user_role#
assign_project_user_role(project_id: str, user_id: str, *, payload: _T.AssignProjectUserRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AssignProjectUserRole200, _Errors]
assign_project_user_role(project_id: str, user_id: str, *, payload: _T.AssignProjectUserRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AssignProjectUserRole200, _HttpClientResponse], _Errors]Assigns a project role to a user within a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
user_id | ||
payload | ||
include_response | = False |
@_t.overload
def assign_project_user_role(self, project_id: str, user_id: str, *, payload: _T.AssignProjectUserRoleRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.AssignProjectUserRole200, _Errors]: ...
@_t.overload
def assign_project_user_role(self, project_id: str, user_id: str, *, payload: _T.AssignProjectUserRoleRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AssignProjectUserRole200, _HttpClientResponse], _Errors]: ...
def assign_project_user_role(self, project_id: str, user_id: str, *, payload: _T.AssignProjectUserRoleRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Assigns a project role to a user within a project."""
return self._json(_ASSIGN_PROJECT_USER_ROLE, _c.encoded_path("/projects/{}/users/{}/roles", project_id, user_id), None, _c.json_body(payload), include_response)retrieve_project_user_role#
retrieve_project_user_role(project_id: str, user_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectUserRole200, _Errors]
retrieve_project_user_role(project_id: str, user_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectUserRole200, _HttpClientResponse], _Errors]Retrieves a project role assigned to a user.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
user_id | ||
role_id | ||
include_response | = False |
@_t.overload
def retrieve_project_user_role(self, project_id: str, user_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveProjectUserRole200, _Errors]: ...
@_t.overload
def retrieve_project_user_role(self, project_id: str, user_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveProjectUserRole200, _HttpClientResponse], _Errors]: ...
def retrieve_project_user_role(self, project_id: str, user_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a project role assigned to a user."""
return self._json(_RETRIEVE_PROJECT_USER_ROLE, _c.encoded_path("/projects/{}/users/{}/roles/{}", project_id, user_id, role_id), None, None, include_response)unassign_project_user_role#
unassign_project_user_role(project_id: str, user_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.UnassignProjectUserRole200, _Errors]
unassign_project_user_role(project_id: str, user_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UnassignProjectUserRole200, _HttpClientResponse], _Errors]Unassigns a project role from a user within a project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
user_id | ||
role_id | ||
include_response | = False |
@_t.overload
def unassign_project_user_role(self, project_id: str, user_id: str, role_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.UnassignProjectUserRole200, _Errors]: ...
@_t.overload
def unassign_project_user_role(self, project_id: str, user_id: str, role_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UnassignProjectUserRole200, _HttpClientResponse], _Errors]: ...
def unassign_project_user_role(self, project_id: str, user_id: str, role_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Unassigns a project role from a user within a project."""
return self._json(_UNASSIGN_PROJECT_USER_ROLE, _c.encoded_path("/projects/{}/users/{}/roles/{}", project_id, user_id, role_id), None, None, include_response)create_realtime_call#
create_realtime_call(*, payload: _T.CreateRealtimeCallRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[None, _PlainErrors]
create_realtime_call(*, payload: _T.CreateRealtimeCallRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _PlainErrors]Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_realtime_call(self, *, payload: _T.CreateRealtimeCallRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[None, _PlainErrors]: ...
@_t.overload
def create_realtime_call(self, *, payload: _T.CreateRealtimeCallRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _PlainErrors]: ...
def create_realtime_call(self, *, payload: _T.CreateRealtimeCallRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _PlainErrors]:
"""Create a new Realtime API call over WebRTC and receive the SDP answer needed
to complete the peer connection."""
return self._json(_CREATE_REALTIME_CALL, "/realtime/calls", None, _c.form_body(payload), include_response)accept_realtime_call#
accept_realtime_call(call_id: str, *, payload: _T.AcceptRealtimeCallRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
accept_realtime_call(call_id: str, *, payload: _T.AcceptRealtimeCallRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]Accept an incoming SIP call and configure the realtime session that will handle it.
| Parameter | Type | Description |
|---|---|---|
call_id | ||
payload | ||
include_response | = False |
@_t.overload
def accept_realtime_call(self, call_id: str, *, payload: _T.AcceptRealtimeCallRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def accept_realtime_call(self, call_id: str, *, payload: _T.AcceptRealtimeCallRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def accept_realtime_call(self, call_id: str, *, payload: _T.AcceptRealtimeCallRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Accept an incoming SIP call and configure the realtime session that will
handle it."""
return self._json(_ACCEPT_REALTIME_CALL, _c.encoded_path("/realtime/calls/{}/accept", call_id), None, _c.json_body(payload), include_response)hangup_realtime_call#
hangup_realtime_call(call_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
hangup_realtime_call(call_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]End an active Realtime API call, whether it was initiated over SIP or WebRTC.
| Parameter | Type | Description |
|---|---|---|
call_id | ||
include_response | = False |
@_t.overload
def hangup_realtime_call(self, call_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def hangup_realtime_call(self, call_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def hangup_realtime_call(self, call_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""End an active Realtime API call, whether it was initiated over SIP or
WebRTC."""
return self._json(_HANGUP_REALTIME_CALL, _c.encoded_path("/realtime/calls/{}/hangup", call_id), None, None, include_response)refer_realtime_call#
refer_realtime_call(call_id: str, *, payload: _T.ReferRealtimeCallRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
refer_realtime_call(call_id: str, *, payload: _T.ReferRealtimeCallRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]Transfer an active SIP call to a new destination using the SIP REFER verb.
| Parameter | Type | Description |
|---|---|---|
call_id | ||
payload | ||
include_response | = False |
@_t.overload
def refer_realtime_call(self, call_id: str, *, payload: _T.ReferRealtimeCallRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def refer_realtime_call(self, call_id: str, *, payload: _T.ReferRealtimeCallRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def refer_realtime_call(self, call_id: str, *, payload: _T.ReferRealtimeCallRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Transfer an active SIP call to a new destination using the SIP REFER verb."""
return self._json(_REFER_REALTIME_CALL, _c.encoded_path("/realtime/calls/{}/refer", call_id), None, _c.json_body(payload), include_response)reject_realtime_call#
reject_realtime_call(call_id: str, *, payload: _T.RejectRealtimeCallRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
reject_realtime_call(call_id: str, *, payload: _T.RejectRealtimeCallRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]Decline an incoming SIP call by returning a SIP status code to the caller.
| Parameter | Type | Description |
|---|---|---|
call_id | ||
payload | ||
include_response | = False |
@_t.overload
def reject_realtime_call(self, call_id: str, *, payload: _T.RejectRealtimeCallRequestJson, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def reject_realtime_call(self, call_id: str, *, payload: _T.RejectRealtimeCallRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def reject_realtime_call(self, call_id: str, *, payload: _T.RejectRealtimeCallRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Decline an incoming SIP call by returning a SIP status code to the caller."""
return self._json(_REJECT_REALTIME_CALL, _c.encoded_path("/realtime/calls/{}/reject", call_id), None, _c.json_body(payload), include_response)create_realtime_client_secret#
create_realtime_client_secret(*, payload: _T.CreateRealtimeClientSecretRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRealtimeClientSecret200, _Errors]
create_realtime_client_secret(*, payload: _T.CreateRealtimeClientSecretRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRealtimeClientSecret200, _HttpClientResponse], _Errors]Create a Realtime client secret with an associated session configuration.
Client secrets are short-lived tokens that can be passed to a client app, such as a web frontend or mobile client, which grants access to the Realtime API without leaking your main API key. You can configure a custom TTL for each client secret.
You can also attach session configuration options to the client secret, which will be applied to any sessions created using that client secret, but these can also be overridden by the client connection.
Learn more about authentication with client secrets over WebRTC.
Returns the created client secret and the effective session object. The client secret is a string that looks like ek_1234.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_realtime_client_secret(self, *, payload: _T.CreateRealtimeClientSecretRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRealtimeClientSecret200, _Errors]: ...
@_t.overload
def create_realtime_client_secret(self, *, payload: _T.CreateRealtimeClientSecretRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRealtimeClientSecret200, _HttpClientResponse], _Errors]: ...
def create_realtime_client_secret(self, *, payload: _T.CreateRealtimeClientSecretRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a Realtime client secret with an associated session configuration.
Client secrets are short-lived tokens that can be passed to a client app,
such as a web frontend or mobile client, which grants access to the Realtime API without
leaking your main API key. You can configure a custom TTL for each client secret.
You can also attach session configuration options to the client secret, which will be
applied to any sessions created using that client secret, but these can also be overridden
by the client connection.
[Learn more about authentication with client secrets over WebRTC](https://developers.openai.com/api/docs/guides/realtime-webrtc).
Returns the created client secret and the effective session object. The client secret is a string that looks like `ek_1234`."""
return self._json(_CREATE_REALTIME_CLIENT_SECRET, "/realtime/client_secrets", None, _c.json_body(payload), include_response)create_realtime_session#
create_realtime_session(*, payload: _T.CreateRealtimeSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRealtimeSession200, _PlainErrors]
create_realtime_session(*, payload: _T.CreateRealtimeSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRealtimeSession200, _HttpClientResponse], _PlainErrors]Create an ephemeral API token for use in client-side applications with the
Realtime API. Can be configured with the same session parameters as the
session.update client event.
It responds with a session object, plus a client_secret key which contains
a usable ephemeral API token that can be used to authenticate browser clients
for the Realtime API.
Returns the created Realtime session object, plus an ephemeral key.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_realtime_session(self, *, payload: _T.CreateRealtimeSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRealtimeSession200, _PlainErrors]: ...
@_t.overload
def create_realtime_session(self, *, payload: _T.CreateRealtimeSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRealtimeSession200, _HttpClientResponse], _PlainErrors]: ...
def create_realtime_session(self, *, payload: _T.CreateRealtimeSessionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _PlainErrors]:
"""Create an ephemeral API token for use in client-side applications with the
Realtime API. Can be configured with the same session parameters as the
`session.update` client event.
It responds with a session object, plus a `client_secret` key which contains
a usable ephemeral API token that can be used to authenticate browser clients
for the Realtime API.
Returns the created Realtime session object, plus an ephemeral key."""
return self._json(_CREATE_REALTIME_SESSION, "/realtime/sessions", None, _c.json_body(payload), include_response)create_realtime_transcription_session#
create_realtime_transcription_session(*, payload: _T.CreateRealtimeTranscriptionSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRealtimeTranscriptionSession200, _PlainErrors]
create_realtime_transcription_session(*, payload: _T.CreateRealtimeTranscriptionSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRealtimeTranscriptionSession200, _HttpClientResponse], _PlainErrors]Create an ephemeral API token for use in client-side applications with the
Realtime API specifically for realtime transcriptions.
Can be configured with the same session parameters as the transcription_session.update client event.
It responds with a session object, plus a client_secret key which contains
a usable ephemeral API token that can be used to authenticate browser clients
for the Realtime API.
Returns the created Realtime transcription session object, plus an ephemeral key.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_realtime_transcription_session(self, *, payload: _T.CreateRealtimeTranscriptionSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRealtimeTranscriptionSession200, _PlainErrors]: ...
@_t.overload
def create_realtime_transcription_session(self, *, payload: _T.CreateRealtimeTranscriptionSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRealtimeTranscriptionSession200, _HttpClientResponse], _PlainErrors]: ...
def create_realtime_transcription_session(self, *, payload: _T.CreateRealtimeTranscriptionSessionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _PlainErrors]:
"""Create an ephemeral API token for use in client-side applications with the
Realtime API specifically for realtime transcriptions.
Can be configured with the same session parameters as the `transcription_session.update` client event.
It responds with a session object, plus a `client_secret` key which contains
a usable ephemeral API token that can be used to authenticate browser clients
for the Realtime API.
Returns the created Realtime transcription session object, plus an ephemeral key."""
return self._json(_CREATE_REALTIME_TRANSCRIPTION_SESSION, "/realtime/transcription_sessions", None, _c.json_body(payload), include_response)create_realtime_translation_client_secret#
create_realtime_translation_client_secret(*, payload: _T.CreateRealtimeTranslationClientSecretRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRealtimeTranslationClientSecret200, _Errors]
create_realtime_translation_client_secret(*, payload: _T.CreateRealtimeTranslationClientSecretRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRealtimeTranslationClientSecret200, _HttpClientResponse], _Errors]Create a Realtime translation client secret with an associated translation session configuration.
Client secrets are short-lived tokens that can be passed to a client app, such as a web frontend or mobile client, which grants access to the Realtime Translation API without leaking your main API key. You can configure a custom TTL for each client secret.
Returns the created client secret and the effective translation session object.
The client secret is a string that looks like ek_1234.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_realtime_translation_client_secret(self, *, payload: _T.CreateRealtimeTranslationClientSecretRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRealtimeTranslationClientSecret200, _Errors]: ...
@_t.overload
def create_realtime_translation_client_secret(self, *, payload: _T.CreateRealtimeTranslationClientSecretRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRealtimeTranslationClientSecret200, _HttpClientResponse], _Errors]: ...
def create_realtime_translation_client_secret(self, *, payload: _T.CreateRealtimeTranslationClientSecretRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a Realtime translation client secret with an associated translation session configuration.
Client secrets are short-lived tokens that can be passed to a client app,
such as a web frontend or mobile client, which grants access to the Realtime
Translation API without leaking your main API key. You can configure a custom
TTL for each client secret.
Returns the created client secret and the effective translation session object.
The client secret is a string that looks like `ek_1234`."""
return self._json(_CREATE_REALTIME_TRANSLATION_CLIENT_SECRET, "/realtime/translations/client_secrets", None, _c.json_body(payload), include_response)create_response#
create_response(*, payload: _T.CreateResponseRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateResponse200, _Errors]
create_response(*, payload: _T.CreateResponseRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateResponse200, _HttpClientResponse], _Errors]Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_response(self, *, payload: _T.CreateResponseRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateResponse200, _Errors]: ...
@_t.overload
def create_response(self, *, payload: _T.CreateResponseRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateResponse200, _HttpClientResponse], _Errors]: ...
def create_response(self, *, payload: _T.CreateResponseRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a model response. Provide [text](https://developers.openai.com/api/docs/guides/text) or
[image](https://developers.openai.com/api/docs/guides/images-vision) inputs to generate [text](https://developers.openai.com/api/docs/guides/text)
or [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have the model call
your own [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use built-in
[tools](https://developers.openai.com/api/docs/guides/tools) like [web search](https://developers.openai.com/api/docs/guides/tools-web-search)
or [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use your own data
as input for the model's response."""
return self._json(_CREATE_RESPONSE, "/responses", None, _c.json_body(payload), include_response)create_response_sse#
create_response_sse(*, payload) -> _Stream[_sse.DataEvent[_T.CreateResponse200Sse], _SseErrors]Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateResponseRequestJson |
Returns _Stream[_sse.DataEvent[_T.CreateResponse200Sse], _SseErrors]
def create_response_sse(self, *, payload: _T.CreateResponseRequestJson) -> _Stream[_sse.DataEvent[_T.CreateResponse200Sse], _SseErrors]:
"""Creates a model response. Provide [text](https://developers.openai.com/api/docs/guides/text) or
[image](https://developers.openai.com/api/docs/guides/images-vision) inputs to generate [text](https://developers.openai.com/api/docs/guides/text)
or [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have the model call
your own [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use built-in
[tools](https://developers.openai.com/api/docs/guides/tools) like [web search](https://developers.openai.com/api/docs/guides/tools-web-search)
or [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use your own data
as input for the model's response."""
return self._sse(_CREATE_RESPONSE_SSE, "/responses", None, _c.json_body(payload), CreateResponse200Sse)get_response#
get_response(response_id: str, *, params: _T.GetResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetResponse200, _Errors]
get_response(response_id: str, *, params: _T.GetResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetResponse200, _HttpClientResponse], _Errors]Retrieves a model response with the given ID.
| Parameter | Type | Description |
|---|---|---|
response_id | ||
params | = None | |
include_response | = False |
@_t.overload
def get_response(self, response_id: str, *, params: _T.GetResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetResponse200, _Errors]: ...
@_t.overload
def get_response(self, response_id: str, *, params: _T.GetResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetResponse200, _HttpClientResponse], _Errors]: ...
def get_response(self, response_id: str, *, params: _T.GetResponseParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a model response with the given ID."""
return self._json(_GET_RESPONSE, _c.encoded_path("/responses/{}", response_id), params, None, include_response)delete_response#
delete_response(response_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteResponse200, _Errors]
delete_response(response_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteResponse200, _HttpClientResponse], _Errors]Deletes a model response with the given ID.
| Parameter | Type | Description |
|---|---|---|
response_id | ||
include_response | = False |
@_t.overload
def delete_response(self, response_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteResponse200, _Errors]: ...
@_t.overload
def delete_response(self, response_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteResponse200, _HttpClientResponse], _Errors]: ...
def delete_response(self, response_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a model response with the given ID."""
return self._json(_DELETE_RESPONSE, _c.encoded_path("/responses/{}", response_id), None, None, include_response)cancel_response#
cancel_response(response_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelResponse200, _Errors]
cancel_response(response_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelResponse200, _HttpClientResponse], _Errors]Cancels a model response with the given ID. Only responses created with
the background parameter set to true can be cancelled.
Learn more.
| Parameter | Type | Description |
|---|---|---|
response_id | ||
include_response | = False |
@_t.overload
def cancel_response(self, response_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelResponse200, _Errors]: ...
@_t.overload
def cancel_response(self, response_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelResponse200, _HttpClientResponse], _Errors]: ...
def cancel_response(self, response_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Cancels a model response with the given ID. Only responses created with
the `background` parameter set to `true` can be cancelled.
[Learn more](https://developers.openai.com/api/docs/guides/background)."""
return self._json(_CANCEL_RESPONSE, _c.encoded_path("/responses/{}/cancel", response_id), None, None, include_response)list_input_items#
list_input_items(response_id: str, *, params: _T.ListInputItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListInputItems200, _Errors]
list_input_items(response_id: str, *, params: _T.ListInputItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListInputItems200, _HttpClientResponse], _Errors]Returns a list of input items for a given response.
| Parameter | Type | Description |
|---|---|---|
response_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_input_items(self, response_id: str, *, params: _T.ListInputItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListInputItems200, _Errors]: ...
@_t.overload
def list_input_items(self, response_id: str, *, params: _T.ListInputItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListInputItems200, _HttpClientResponse], _Errors]: ...
def list_input_items(self, response_id: str, *, params: _T.ListInputItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of input items for a given response."""
return self._json(_LIST_INPUT_ITEMS, _c.encoded_path("/responses/{}/input_items", response_id), params, None, include_response)create_thread#
create_thread(*, payload: _T.CreateThreadRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateThread200, _Errors]
create_thread(*, payload: _T.CreateThreadRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateThread200, _HttpClientResponse], _Errors]Create a thread.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_thread(self, *, payload: _T.CreateThreadRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateThread200, _Errors]: ...
@_t.overload
def create_thread(self, *, payload: _T.CreateThreadRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateThread200, _HttpClientResponse], _Errors]: ...
def create_thread(self, *, payload: _T.CreateThreadRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a thread."""
return self._json(_CREATE_THREAD, "/threads", None, _c.json_body(payload), include_response)create_thread_and_run#
create_thread_and_run(*, payload: _T.CreateThreadAndRunRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateThreadAndRun200, _Errors]
create_thread_and_run(*, payload: _T.CreateThreadAndRunRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateThreadAndRun200, _HttpClientResponse], _Errors]Create a thread and run it in one request.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_thread_and_run(self, *, payload: _T.CreateThreadAndRunRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateThreadAndRun200, _Errors]: ...
@_t.overload
def create_thread_and_run(self, *, payload: _T.CreateThreadAndRunRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateThreadAndRun200, _HttpClientResponse], _Errors]: ...
def create_thread_and_run(self, *, payload: _T.CreateThreadAndRunRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a thread and run it in one request."""
return self._json(_CREATE_THREAD_AND_RUN, "/threads/runs", None, _c.json_body(payload), include_response)create_thread_and_run_sse#
create_thread_and_run_sse(*, payload) -> _Stream[_sse.DataEvent[_T.CreateThreadAndRun200Sse], _SseErrors]Create a thread and run it in one request.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateThreadAndRunRequestJson |
Returns _Stream[_sse.DataEvent[_T.CreateThreadAndRun200Sse], _SseErrors]
def create_thread_and_run_sse(self, *, payload: _T.CreateThreadAndRunRequestJson) -> _Stream[_sse.DataEvent[_T.CreateThreadAndRun200Sse], _SseErrors]:
"""Create a thread and run it in one request."""
return self._sse(_CREATE_THREAD_AND_RUN_SSE, "/threads/runs", None, _c.json_body(payload), CreateThreadAndRun200Sse)get_thread#
get_thread(thread_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetThread200, _Errors]
get_thread(thread_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetThread200, _HttpClientResponse], _Errors]Retrieves a thread.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
include_response | = False |
@_t.overload
def get_thread(self, thread_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetThread200, _Errors]: ...
@_t.overload
def get_thread(self, thread_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetThread200, _HttpClientResponse], _Errors]: ...
def get_thread(self, thread_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a thread."""
return self._json(_GET_THREAD, _c.encoded_path("/threads/{}", thread_id), None, None, include_response)modify_thread#
modify_thread(thread_id: str, *, payload: _T.ModifyThreadRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyThread200, _Errors]
modify_thread(thread_id: str, *, payload: _T.ModifyThreadRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyThread200, _HttpClientResponse], _Errors]Modifies a thread.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_thread(self, thread_id: str, *, payload: _T.ModifyThreadRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyThread200, _Errors]: ...
@_t.overload
def modify_thread(self, thread_id: str, *, payload: _T.ModifyThreadRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyThread200, _HttpClientResponse], _Errors]: ...
def modify_thread(self, thread_id: str, *, payload: _T.ModifyThreadRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modifies a thread."""
return self._json(_MODIFY_THREAD, _c.encoded_path("/threads/{}", thread_id), None, _c.json_body(payload), include_response)delete_thread#
delete_thread(thread_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteThread200, _Errors]
delete_thread(thread_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteThread200, _HttpClientResponse], _Errors]Delete a thread.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
include_response | = False |
@_t.overload
def delete_thread(self, thread_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteThread200, _Errors]: ...
@_t.overload
def delete_thread(self, thread_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteThread200, _HttpClientResponse], _Errors]: ...
def delete_thread(self, thread_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a thread."""
return self._json(_DELETE_THREAD, _c.encoded_path("/threads/{}", thread_id), None, None, include_response)list_messages#
list_messages(thread_id: str, *, params: _T.ListMessagesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListMessages200, _Errors]
list_messages(thread_id: str, *, params: _T.ListMessagesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListMessages200, _HttpClientResponse], _Errors]Returns a list of messages for a given thread.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_messages(self, thread_id: str, *, params: _T.ListMessagesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListMessages200, _Errors]: ...
@_t.overload
def list_messages(self, thread_id: str, *, params: _T.ListMessagesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListMessages200, _HttpClientResponse], _Errors]: ...
def list_messages(self, thread_id: str, *, params: _T.ListMessagesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of messages for a given thread."""
return self._json(_LIST_MESSAGES, _c.encoded_path("/threads/{}/messages", thread_id), params, None, include_response)create_message#
create_message(thread_id: str, *, payload: _T.CreateMessageRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateMessage200, _Errors]
create_message(thread_id: str, *, payload: _T.CreateMessageRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateMessage200, _HttpClientResponse], _Errors]Create a message.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_message(self, thread_id: str, *, payload: _T.CreateMessageRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateMessage200, _Errors]: ...
@_t.overload
def create_message(self, thread_id: str, *, payload: _T.CreateMessageRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateMessage200, _HttpClientResponse], _Errors]: ...
def create_message(self, thread_id: str, *, payload: _T.CreateMessageRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a message."""
return self._json(_CREATE_MESSAGE, _c.encoded_path("/threads/{}/messages", thread_id), None, _c.json_body(payload), include_response)get_message#
get_message(thread_id: str, message_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetMessage200, _Errors]
get_message(thread_id: str, message_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetMessage200, _HttpClientResponse], _Errors]Retrieve a message.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
message_id | ||
include_response | = False |
@_t.overload
def get_message(self, thread_id: str, message_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetMessage200, _Errors]: ...
@_t.overload
def get_message(self, thread_id: str, message_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetMessage200, _HttpClientResponse], _Errors]: ...
def get_message(self, thread_id: str, message_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieve a message."""
return self._json(_GET_MESSAGE, _c.encoded_path("/threads/{}/messages/{}", thread_id, message_id), None, None, include_response)modify_message#
modify_message(thread_id: str, message_id: str, *, payload: _T.ModifyMessageRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyMessage200, _Errors]
modify_message(thread_id: str, message_id: str, *, payload: _T.ModifyMessageRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyMessage200, _HttpClientResponse], _Errors]Modifies a message.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
message_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_message(self, thread_id: str, message_id: str, *, payload: _T.ModifyMessageRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyMessage200, _Errors]: ...
@_t.overload
def modify_message(self, thread_id: str, message_id: str, *, payload: _T.ModifyMessageRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyMessage200, _HttpClientResponse], _Errors]: ...
def modify_message(self, thread_id: str, message_id: str, *, payload: _T.ModifyMessageRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modifies a message."""
return self._json(_MODIFY_MESSAGE, _c.encoded_path("/threads/{}/messages/{}", thread_id, message_id), None, _c.json_body(payload), include_response)delete_message#
delete_message(thread_id: str, message_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteMessage200, _Errors]
delete_message(thread_id: str, message_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteMessage200, _HttpClientResponse], _Errors]Deletes a message.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
message_id | ||
include_response | = False |
@_t.overload
def delete_message(self, thread_id: str, message_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteMessage200, _Errors]: ...
@_t.overload
def delete_message(self, thread_id: str, message_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteMessage200, _HttpClientResponse], _Errors]: ...
def delete_message(self, thread_id: str, message_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a message."""
return self._json(_DELETE_MESSAGE, _c.encoded_path("/threads/{}/messages/{}", thread_id, message_id), None, None, include_response)list_runs#
list_runs(thread_id: str, *, params: _T.ListRunsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListRuns200, _Errors]
list_runs(thread_id: str, *, params: _T.ListRunsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListRuns200, _HttpClientResponse], _Errors]Returns a list of runs belonging to a thread.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_runs(self, thread_id: str, *, params: _T.ListRunsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListRuns200, _Errors]: ...
@_t.overload
def list_runs(self, thread_id: str, *, params: _T.ListRunsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListRuns200, _HttpClientResponse], _Errors]: ...
def list_runs(self, thread_id: str, *, params: _T.ListRunsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of runs belonging to a thread."""
return self._json(_LIST_RUNS, _c.encoded_path("/threads/{}/runs", thread_id), params, None, include_response)create_run#
create_run(thread_id: str, *, payload: _T.CreateRunRequestJson, params: _T.CreateRunParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRun200, _Errors]
create_run(thread_id: str, *, payload: _T.CreateRunRequestJson, params: _T.CreateRunParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRun200, _HttpClientResponse], _Errors]Create a run.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
payload | ||
params | = None | |
include_response | = False |
@_t.overload
def create_run(self, thread_id: str, *, payload: _T.CreateRunRequestJson, params: _T.CreateRunParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateRun200, _Errors]: ...
@_t.overload
def create_run(self, thread_id: str, *, payload: _T.CreateRunRequestJson, params: _T.CreateRunParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateRun200, _HttpClientResponse], _Errors]: ...
def create_run(self, thread_id: str, *, payload: _T.CreateRunRequestJson, params: _T.CreateRunParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a run."""
return self._json(_CREATE_RUN, _c.encoded_path("/threads/{}/runs", thread_id), params, _c.json_body(payload), include_response)create_run_sse#
create_run_sse(thread_id, *, payload, params=None) -> _Stream[_sse.DataEvent[_T.CreateRun200Sse], _SseErrors]Create a run.
| Parameter | Type | Description |
|---|---|---|
thread_id | str | |
payload | _T.CreateRunRequestJson | |
params | _T.CreateRunParams | None = None |
Returns _Stream[_sse.DataEvent[_T.CreateRun200Sse], _SseErrors]
def create_run_sse(self, thread_id: str, *, payload: _T.CreateRunRequestJson, params: _T.CreateRunParams | None = None) -> _Stream[_sse.DataEvent[_T.CreateRun200Sse], _SseErrors]:
"""Create a run."""
return self._sse(_CREATE_RUN_SSE, _c.encoded_path("/threads/{}/runs", thread_id), params, _c.json_body(payload), CreateRun200Sse)get_run#
get_run(thread_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetRun200, _Errors]
get_run(thread_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetRun200, _HttpClientResponse], _Errors]Retrieves a run.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
run_id | ||
include_response | = False |
@_t.overload
def get_run(self, thread_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetRun200, _Errors]: ...
@_t.overload
def get_run(self, thread_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetRun200, _HttpClientResponse], _Errors]: ...
def get_run(self, thread_id: str, run_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a run."""
return self._json(_GET_RUN, _c.encoded_path("/threads/{}/runs/{}", thread_id, run_id), None, None, include_response)modify_run#
modify_run(thread_id: str, run_id: str, *, payload: _T.ModifyRunRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyRun200, _Errors]
modify_run(thread_id: str, run_id: str, *, payload: _T.ModifyRunRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyRun200, _HttpClientResponse], _Errors]Modifies a run.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
run_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_run(self, thread_id: str, run_id: str, *, payload: _T.ModifyRunRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyRun200, _Errors]: ...
@_t.overload
def modify_run(self, thread_id: str, run_id: str, *, payload: _T.ModifyRunRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyRun200, _HttpClientResponse], _Errors]: ...
def modify_run(self, thread_id: str, run_id: str, *, payload: _T.ModifyRunRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modifies a run."""
return self._json(_MODIFY_RUN, _c.encoded_path("/threads/{}/runs/{}", thread_id, run_id), None, _c.json_body(payload), include_response)cancel_run#
cancel_run(thread_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelRun200, _Errors]
cancel_run(thread_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelRun200, _HttpClientResponse], _Errors]Cancels a run that is in_progress.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
run_id | ||
include_response | = False |
@_t.overload
def cancel_run(self, thread_id: str, run_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelRun200, _Errors]: ...
@_t.overload
def cancel_run(self, thread_id: str, run_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelRun200, _HttpClientResponse], _Errors]: ...
def cancel_run(self, thread_id: str, run_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Cancels a run that is `in_progress`."""
return self._json(_CANCEL_RUN, _c.encoded_path("/threads/{}/runs/{}/cancel", thread_id, run_id), None, None, include_response)list_run_steps#
list_run_steps(thread_id: str, run_id: str, *, params: _T.ListRunStepsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListRunSteps200, _Errors]
list_run_steps(thread_id: str, run_id: str, *, params: _T.ListRunStepsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListRunSteps200, _HttpClientResponse], _Errors]Returns a list of run steps belonging to a run.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
run_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_run_steps(self, thread_id: str, run_id: str, *, params: _T.ListRunStepsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListRunSteps200, _Errors]: ...
@_t.overload
def list_run_steps(self, thread_id: str, run_id: str, *, params: _T.ListRunStepsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListRunSteps200, _HttpClientResponse], _Errors]: ...
def list_run_steps(self, thread_id: str, run_id: str, *, params: _T.ListRunStepsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of run steps belonging to a run."""
return self._json(_LIST_RUN_STEPS, _c.encoded_path("/threads/{}/runs/{}/steps", thread_id, run_id), params, None, include_response)get_run_step#
get_run_step(thread_id: str, run_id: str, step_id: str, *, params: _T.GetRunStepParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetRunStep200, _Errors]
get_run_step(thread_id: str, run_id: str, step_id: str, *, params: _T.GetRunStepParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetRunStep200, _HttpClientResponse], _Errors]Retrieves a run step.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
run_id | ||
step_id | ||
params | = None | |
include_response | = False |
@_t.overload
def get_run_step(self, thread_id: str, run_id: str, step_id: str, *, params: _T.GetRunStepParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.GetRunStep200, _Errors]: ...
@_t.overload
def get_run_step(self, thread_id: str, run_id: str, step_id: str, *, params: _T.GetRunStepParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetRunStep200, _HttpClientResponse], _Errors]: ...
def get_run_step(self, thread_id: str, run_id: str, step_id: str, *, params: _T.GetRunStepParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a run step."""
return self._json(_GET_RUN_STEP, _c.encoded_path("/threads/{}/runs/{}/steps/{}", thread_id, run_id, step_id), params, None, include_response)submit_tool_ouputs_to_run#
submit_tool_ouputs_to_run(thread_id: str, run_id: str, *, payload: _T.SubmitToolOuputsToRunRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.SubmitToolOuputsToRun200, _Errors]
submit_tool_ouputs_to_run(thread_id: str, run_id: str, *, payload: _T.SubmitToolOuputsToRunRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.SubmitToolOuputsToRun200, _HttpClientResponse], _Errors]When a run has the status: "requires_action" and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
run_id | ||
payload | ||
include_response | = False |
@_t.overload
def submit_tool_ouputs_to_run(self, thread_id: str, run_id: str, *, payload: _T.SubmitToolOuputsToRunRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.SubmitToolOuputsToRun200, _Errors]: ...
@_t.overload
def submit_tool_ouputs_to_run(self, thread_id: str, run_id: str, *, payload: _T.SubmitToolOuputsToRunRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.SubmitToolOuputsToRun200, _HttpClientResponse], _Errors]: ...
def submit_tool_ouputs_to_run(self, thread_id: str, run_id: str, *, payload: _T.SubmitToolOuputsToRunRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request."""
return self._json(_SUBMIT_TOOL_OUPUTS_TO_RUN, _c.encoded_path("/threads/{}/runs/{}/submit_tool_outputs", thread_id, run_id), None, _c.json_body(payload), include_response)submit_tool_ouputs_to_run_sse#
submit_tool_ouputs_to_run_sse(thread_id, run_id, *, payload) -> _Stream[_sse.DataEvent[_T.SubmitToolOuputsToRun200Sse], _SseErrors]When a run has the status: "requires_action" and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.
| Parameter | Type | Description |
|---|---|---|
thread_id | str | |
run_id | str | |
payload | _T.SubmitToolOuputsToRunRequestJson |
Returns _Stream[_sse.DataEvent[_T.SubmitToolOuputsToRun200Sse], _SseErrors]
def submit_tool_ouputs_to_run_sse(self, thread_id: str, run_id: str, *, payload: _T.SubmitToolOuputsToRunRequestJson) -> _Stream[_sse.DataEvent[_T.SubmitToolOuputsToRun200Sse], _SseErrors]:
"""When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request."""
return self._sse(_SUBMIT_TOOL_OUPUTS_TO_RUN_SSE, _c.encoded_path("/threads/{}/runs/{}/submit_tool_outputs", thread_id, run_id), None, _c.json_body(payload), SubmitToolOuputsToRun200Sse)create_upload#
create_upload(*, payload: _T.CreateUploadRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateUpload200, _Errors]
create_upload(*, payload: _T.CreateUploadRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateUpload200, _HttpClientResponse], _Errors]Creates an intermediate Upload object that you can add Parts to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it.
Once you complete the Upload, we will create a File object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object.
For certain purpose values, the correct mime_type must be specified.
Please refer to documentation for the
supported MIME types for your use case.
For guidance on the proper filename extensions for each purpose, please follow the documentation on creating a File.
Returns the Upload object with status pending.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_upload(self, *, payload: _T.CreateUploadRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateUpload200, _Errors]: ...
@_t.overload
def create_upload(self, *, payload: _T.CreateUploadRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateUpload200, _HttpClientResponse], _Errors]: ...
def create_upload(self, *, payload: _T.CreateUploadRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates an intermediate [Upload](https://developers.openai.com/api/reference/resources/uploads) object
that you can add [Parts](https://developers.openai.com/api/reference/resources/uploads/subresources/parts) to.
Currently, an Upload can accept at most 8 GB in total and expires after an
hour after you create it.
Once you complete the Upload, we will create a
[File](https://developers.openai.com/api/reference/resources/files) object that contains all the parts
you uploaded. This File is usable in the rest of our platform as a regular
File object.
For certain `purpose` values, the correct `mime_type` must be specified.
Please refer to documentation for the
[supported MIME types for your use case](https://developers.openai.com/api/docs/guides/tools-file-search#supported-files).
For guidance on the proper filename extensions for each purpose, please
follow the documentation on [creating a
File](https://developers.openai.com/api/reference/resources/files/methods/create).
Returns the Upload object with status `pending`."""
return self._json(_CREATE_UPLOAD, "/uploads", None, _c.json_body(payload), include_response)cancel_upload#
cancel_upload(upload_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelUpload200, _Errors]
cancel_upload(upload_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelUpload200, _HttpClientResponse], _Errors]Cancels the Upload. No Parts may be added after an Upload is cancelled.
Returns the Upload object with status cancelled.
| Parameter | Type | Description |
|---|---|---|
upload_id | ||
include_response | = False |
@_t.overload
def cancel_upload(self, upload_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelUpload200, _Errors]: ...
@_t.overload
def cancel_upload(self, upload_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelUpload200, _HttpClientResponse], _Errors]: ...
def cancel_upload(self, upload_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Cancels the Upload. No Parts may be added after an Upload is cancelled.
Returns the Upload object with status `cancelled`."""
return self._json(_CANCEL_UPLOAD, _c.encoded_path("/uploads/{}/cancel", upload_id), None, None, include_response)complete_upload#
complete_upload(upload_id: str, *, payload: _T.CompleteUploadRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CompleteUpload200, _Errors]
complete_upload(upload_id: str, *, payload: _T.CompleteUploadRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CompleteUpload200, _HttpClientResponse], _Errors]Completes the Upload.
Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform.
You can specify the order of the Parts by passing in an ordered list of the Part IDs.
The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed.
Returns the Upload object with status completed, including an additional file property containing the created usable File object.
| Parameter | Type | Description |
|---|---|---|
upload_id | ||
payload | ||
include_response | = False |
@_t.overload
def complete_upload(self, upload_id: str, *, payload: _T.CompleteUploadRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CompleteUpload200, _Errors]: ...
@_t.overload
def complete_upload(self, upload_id: str, *, payload: _T.CompleteUploadRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CompleteUpload200, _HttpClientResponse], _Errors]: ...
def complete_upload(self, upload_id: str, *, payload: _T.CompleteUploadRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Completes the [Upload](https://developers.openai.com/api/reference/resources/uploads).
Within the returned Upload object, there is a nested [File](https://developers.openai.com/api/reference/resources/files) object that is ready to use in the rest of the platform.
You can specify the order of the Parts by passing in an ordered list of the Part IDs.
The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed.
Returns the Upload object with status `completed`, including an additional `file` property containing the created usable File object."""
return self._json(_COMPLETE_UPLOAD, _c.encoded_path("/uploads/{}/complete", upload_id), None, _c.json_body(payload), include_response)add_upload_part#
add_upload_part(upload_id: str, *, payload: _T.AddUploadPartRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.AddUploadPart200, _Errors]
add_upload_part(upload_id: str, *, payload: _T.AddUploadPartRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AddUploadPart200, _HttpClientResponse], _Errors]Adds a Part to an Upload object. A Part represents a chunk of bytes from the file you are trying to upload.
Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB.
It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you complete the Upload.
| Parameter | Type | Description |
|---|---|---|
upload_id | ||
payload | ||
include_response | = False |
@_t.overload
def add_upload_part(self, upload_id: str, *, payload: _T.AddUploadPartRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.AddUploadPart200, _Errors]: ...
@_t.overload
def add_upload_part(self, upload_id: str, *, payload: _T.AddUploadPartRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.AddUploadPart200, _HttpClientResponse], _Errors]: ...
def add_upload_part(self, upload_id: str, *, payload: _T.AddUploadPartRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Adds a [Part](https://developers.openai.com/api/reference/resources/uploads/subresources/parts) to an [Upload](https://developers.openai.com/api/reference/resources/uploads) object. A Part represents a chunk of bytes from the file you are trying to upload.
Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB.
It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you [complete the Upload](https://developers.openai.com/api/reference/resources/uploads/methods/complete)."""
return self._json(_ADD_UPLOAD_PART, _c.encoded_path("/uploads/{}/parts", upload_id), None, _c.form_body(payload), include_response)list_vector_stores#
list_vector_stores(*, params: _T.ListVectorStoresParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVectorStores200, _Errors]
list_vector_stores(*, params: _T.ListVectorStoresParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVectorStores200, _HttpClientResponse], _Errors]Returns a list of vector stores.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_vector_stores(self, *, params: _T.ListVectorStoresParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVectorStores200, _Errors]: ...
@_t.overload
def list_vector_stores(self, *, params: _T.ListVectorStoresParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVectorStores200, _HttpClientResponse], _Errors]: ...
def list_vector_stores(self, *, params: _T.ListVectorStoresParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of vector stores."""
return self._json(_LIST_VECTOR_STORES, "/vector_stores", params, None, include_response)create_vector_store#
create_vector_store(*, payload: _T.CreateVectorStoreRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVectorStore200, _Errors]
create_vector_store(*, payload: _T.CreateVectorStoreRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVectorStore200, _HttpClientResponse], _Errors]Create a vector store.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_vector_store(self, *, payload: _T.CreateVectorStoreRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVectorStore200, _Errors]: ...
@_t.overload
def create_vector_store(self, *, payload: _T.CreateVectorStoreRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVectorStore200, _HttpClientResponse], _Errors]: ...
def create_vector_store(self, *, payload: _T.CreateVectorStoreRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a vector store."""
return self._json(_CREATE_VECTOR_STORE, "/vector_stores", None, _c.json_body(payload), include_response)get_vector_store#
get_vector_store(vector_store_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVectorStore200, _Errors]
get_vector_store(vector_store_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVectorStore200, _HttpClientResponse], _Errors]Retrieves a vector store.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
include_response | = False |
@_t.overload
def get_vector_store(self, vector_store_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVectorStore200, _Errors]: ...
@_t.overload
def get_vector_store(self, vector_store_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVectorStore200, _HttpClientResponse], _Errors]: ...
def get_vector_store(self, vector_store_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a vector store."""
return self._json(_GET_VECTOR_STORE, _c.encoded_path("/vector_stores/{}", vector_store_id), None, None, include_response)modify_vector_store#
modify_vector_store(vector_store_id: str, *, payload: _T.ModifyVectorStoreRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyVectorStore200, _Errors]
modify_vector_store(vector_store_id: str, *, payload: _T.ModifyVectorStoreRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyVectorStore200, _HttpClientResponse], _Errors]Modifies a vector store.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
payload | ||
include_response | = False |
@_t.overload
def modify_vector_store(self, vector_store_id: str, *, payload: _T.ModifyVectorStoreRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.ModifyVectorStore200, _Errors]: ...
@_t.overload
def modify_vector_store(self, vector_store_id: str, *, payload: _T.ModifyVectorStoreRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ModifyVectorStore200, _HttpClientResponse], _Errors]: ...
def modify_vector_store(self, vector_store_id: str, *, payload: _T.ModifyVectorStoreRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Modifies a vector store."""
return self._json(_MODIFY_VECTOR_STORE, _c.encoded_path("/vector_stores/{}", vector_store_id), None, _c.json_body(payload), include_response)delete_vector_store#
delete_vector_store(vector_store_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVectorStore200, _Errors]
delete_vector_store(vector_store_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVectorStore200, _HttpClientResponse], _Errors]Delete a vector store.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
include_response | = False |
@_t.overload
def delete_vector_store(self, vector_store_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVectorStore200, _Errors]: ...
@_t.overload
def delete_vector_store(self, vector_store_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVectorStore200, _HttpClientResponse], _Errors]: ...
def delete_vector_store(self, vector_store_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a vector store."""
return self._json(_DELETE_VECTOR_STORE, _c.encoded_path("/vector_stores/{}", vector_store_id), None, None, include_response)create_vector_store_file_batch#
create_vector_store_file_batch(vector_store_id: str, *, payload: _T.CreateVectorStoreFileBatchRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVectorStoreFileBatch200, _Errors]
create_vector_store_file_batch(vector_store_id: str, *, payload: _T.CreateVectorStoreFileBatchRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVectorStoreFileBatch200, _HttpClientResponse], _Errors]Create a vector store file batch.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_vector_store_file_batch(self, vector_store_id: str, *, payload: _T.CreateVectorStoreFileBatchRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVectorStoreFileBatch200, _Errors]: ...
@_t.overload
def create_vector_store_file_batch(self, vector_store_id: str, *, payload: _T.CreateVectorStoreFileBatchRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVectorStoreFileBatch200, _HttpClientResponse], _Errors]: ...
def create_vector_store_file_batch(self, vector_store_id: str, *, payload: _T.CreateVectorStoreFileBatchRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a vector store file batch."""
return self._json(_CREATE_VECTOR_STORE_FILE_BATCH, _c.encoded_path("/vector_stores/{}/file_batches", vector_store_id), None, _c.json_body(payload), include_response)get_vector_store_file_batch#
get_vector_store_file_batch(vector_store_id: str, batch_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVectorStoreFileBatch200, _Errors]
get_vector_store_file_batch(vector_store_id: str, batch_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVectorStoreFileBatch200, _HttpClientResponse], _Errors]Retrieves a vector store file batch.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
batch_id | ||
include_response | = False |
@_t.overload
def get_vector_store_file_batch(self, vector_store_id: str, batch_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVectorStoreFileBatch200, _Errors]: ...
@_t.overload
def get_vector_store_file_batch(self, vector_store_id: str, batch_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVectorStoreFileBatch200, _HttpClientResponse], _Errors]: ...
def get_vector_store_file_batch(self, vector_store_id: str, batch_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a vector store file batch."""
return self._json(_GET_VECTOR_STORE_FILE_BATCH, _c.encoded_path("/vector_stores/{}/file_batches/{}", vector_store_id, batch_id), None, None, include_response)cancel_vector_store_file_batch#
cancel_vector_store_file_batch(vector_store_id: str, batch_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelVectorStoreFileBatch200, _Errors]
cancel_vector_store_file_batch(vector_store_id: str, batch_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelVectorStoreFileBatch200, _HttpClientResponse], _Errors]Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
batch_id | ||
include_response | = False |
@_t.overload
def cancel_vector_store_file_batch(self, vector_store_id: str, batch_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelVectorStoreFileBatch200, _Errors]: ...
@_t.overload
def cancel_vector_store_file_batch(self, vector_store_id: str, batch_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelVectorStoreFileBatch200, _HttpClientResponse], _Errors]: ...
def cancel_vector_store_file_batch(self, vector_store_id: str, batch_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible."""
return self._json(_CANCEL_VECTOR_STORE_FILE_BATCH, _c.encoded_path("/vector_stores/{}/file_batches/{}/cancel", vector_store_id, batch_id), None, None, include_response)list_files_in_vector_store_batch#
list_files_in_vector_store_batch(vector_store_id: str, batch_id: str, *, params: _T.ListFilesInVectorStoreBatchParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFilesInVectorStoreBatch200, _Errors]
list_files_in_vector_store_batch(vector_store_id: str, batch_id: str, *, params: _T.ListFilesInVectorStoreBatchParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFilesInVectorStoreBatch200, _HttpClientResponse], _Errors]Returns a list of vector store files in a batch.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
batch_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_files_in_vector_store_batch(self, vector_store_id: str, batch_id: str, *, params: _T.ListFilesInVectorStoreBatchParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListFilesInVectorStoreBatch200, _Errors]: ...
@_t.overload
def list_files_in_vector_store_batch(self, vector_store_id: str, batch_id: str, *, params: _T.ListFilesInVectorStoreBatchParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListFilesInVectorStoreBatch200, _HttpClientResponse], _Errors]: ...
def list_files_in_vector_store_batch(self, vector_store_id: str, batch_id: str, *, params: _T.ListFilesInVectorStoreBatchParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of vector store files in a batch."""
return self._json(_LIST_FILES_IN_VECTOR_STORE_BATCH, _c.encoded_path("/vector_stores/{}/file_batches/{}/files", vector_store_id, batch_id), params, None, include_response)list_vector_store_files#
list_vector_store_files(vector_store_id: str, *, params: _T.ListVectorStoreFilesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVectorStoreFiles200, _Errors]
list_vector_store_files(vector_store_id: str, *, params: _T.ListVectorStoreFilesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVectorStoreFiles200, _HttpClientResponse], _Errors]Returns a list of vector store files.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_vector_store_files(self, vector_store_id: str, *, params: _T.ListVectorStoreFilesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVectorStoreFiles200, _Errors]: ...
@_t.overload
def list_vector_store_files(self, vector_store_id: str, *, params: _T.ListVectorStoreFilesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVectorStoreFiles200, _HttpClientResponse], _Errors]: ...
def list_vector_store_files(self, vector_store_id: str, *, params: _T.ListVectorStoreFilesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of vector store files."""
return self._json(_LIST_VECTOR_STORE_FILES, _c.encoded_path("/vector_stores/{}/files", vector_store_id), params, None, include_response)create_vector_store_file#
create_vector_store_file(vector_store_id: str, *, payload: _T.CreateVectorStoreFileRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVectorStoreFile200, _Errors]
create_vector_store_file(vector_store_id: str, *, payload: _T.CreateVectorStoreFileRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVectorStoreFile200, _HttpClientResponse], _Errors]Create a vector store file by attaching a File to a vector store.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_vector_store_file(self, vector_store_id: str, *, payload: _T.CreateVectorStoreFileRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVectorStoreFile200, _Errors]: ...
@_t.overload
def create_vector_store_file(self, vector_store_id: str, *, payload: _T.CreateVectorStoreFileRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVectorStoreFile200, _HttpClientResponse], _Errors]: ...
def create_vector_store_file(self, vector_store_id: str, *, payload: _T.CreateVectorStoreFileRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a vector store file by attaching a [File](https://developers.openai.com/api/reference/resources/files) to a [vector store](https://developers.openai.com/api/reference/resources/vector_stores)."""
return self._json(_CREATE_VECTOR_STORE_FILE, _c.encoded_path("/vector_stores/{}/files", vector_store_id), None, _c.json_body(payload), include_response)get_vector_store_file#
get_vector_store_file(vector_store_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVectorStoreFile200, _Errors]
get_vector_store_file(vector_store_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVectorStoreFile200, _HttpClientResponse], _Errors]Retrieves a vector store file.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
file_id | ||
include_response | = False |
@_t.overload
def get_vector_store_file(self, vector_store_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVectorStoreFile200, _Errors]: ...
@_t.overload
def get_vector_store_file(self, vector_store_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVectorStoreFile200, _HttpClientResponse], _Errors]: ...
def get_vector_store_file(self, vector_store_id: str, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a vector store file."""
return self._json(_GET_VECTOR_STORE_FILE, _c.encoded_path("/vector_stores/{}/files/{}", vector_store_id, file_id), None, None, include_response)update_vector_store_file_attributes#
update_vector_store_file_attributes(vector_store_id: str, file_id: str, *, payload: _T.UpdateVectorStoreFileAttributesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateVectorStoreFileAttributes200, _Errors]
update_vector_store_file_attributes(vector_store_id: str, file_id: str, *, payload: _T.UpdateVectorStoreFileAttributesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateVectorStoreFileAttributes200, _HttpClientResponse], _Errors]Update attributes on a vector store file.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
file_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_vector_store_file_attributes(self, vector_store_id: str, file_id: str, *, payload: _T.UpdateVectorStoreFileAttributesRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateVectorStoreFileAttributes200, _Errors]: ...
@_t.overload
def update_vector_store_file_attributes(self, vector_store_id: str, file_id: str, *, payload: _T.UpdateVectorStoreFileAttributesRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateVectorStoreFileAttributes200, _HttpClientResponse], _Errors]: ...
def update_vector_store_file_attributes(self, vector_store_id: str, file_id: str, *, payload: _T.UpdateVectorStoreFileAttributesRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Update attributes on a vector store file."""
return self._json(_UPDATE_VECTOR_STORE_FILE_ATTRIBUTES, _c.encoded_path("/vector_stores/{}/files/{}", vector_store_id, file_id), None, _c.json_body(payload), include_response)delete_vector_store_file#
delete_vector_store_file(vector_store_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVectorStoreFile200, _Errors]
delete_vector_store_file(vector_store_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVectorStoreFile200, _HttpClientResponse], _Errors]Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
file_id | ||
include_response | = False |
@_t.overload
def delete_vector_store_file(self, vector_store_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVectorStoreFile200, _Errors]: ...
@_t.overload
def delete_vector_store_file(self, vector_store_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVectorStoreFile200, _HttpClientResponse], _Errors]: ...
def delete_vector_store_file(self, vector_store_id: str, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](https://developers.openai.com/api/reference/resources/files/methods/delete) endpoint."""
return self._json(_DELETE_VECTOR_STORE_FILE, _c.encoded_path("/vector_stores/{}/files/{}", vector_store_id, file_id), None, None, include_response)retrieve_vector_store_file_content#
retrieve_vector_store_file_content(vector_store_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveVectorStoreFileContent200, _Errors]
retrieve_vector_store_file_content(vector_store_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveVectorStoreFileContent200, _HttpClientResponse], _Errors]Retrieve the parsed contents of a vector store file.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
file_id | ||
include_response | = False |
@_t.overload
def retrieve_vector_store_file_content(self, vector_store_id: str, file_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveVectorStoreFileContent200, _Errors]: ...
@_t.overload
def retrieve_vector_store_file_content(self, vector_store_id: str, file_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveVectorStoreFileContent200, _HttpClientResponse], _Errors]: ...
def retrieve_vector_store_file_content(self, vector_store_id: str, file_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieve the parsed contents of a vector store file."""
return self._json(_RETRIEVE_VECTOR_STORE_FILE_CONTENT, _c.encoded_path("/vector_stores/{}/files/{}/content", vector_store_id, file_id), None, None, include_response)search_vector_store#
search_vector_store(vector_store_id: str, *, payload: _T.SearchVectorStoreRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.SearchVectorStore200, _Errors]
search_vector_store(vector_store_id: str, *, payload: _T.SearchVectorStoreRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.SearchVectorStore200, _HttpClientResponse], _Errors]Search a vector store for relevant chunks based on a query and file attributes filter.
| Parameter | Type | Description |
|---|---|---|
vector_store_id | ||
payload | ||
include_response | = False |
@_t.overload
def search_vector_store(self, vector_store_id: str, *, payload: _T.SearchVectorStoreRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.SearchVectorStore200, _Errors]: ...
@_t.overload
def search_vector_store(self, vector_store_id: str, *, payload: _T.SearchVectorStoreRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.SearchVectorStore200, _HttpClientResponse], _Errors]: ...
def search_vector_store(self, vector_store_id: str, *, payload: _T.SearchVectorStoreRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Search a vector store for relevant chunks based on a query and file attributes filter."""
return self._json(_SEARCH_VECTOR_STORE, _c.encoded_path("/vector_stores/{}/search", vector_store_id), None, _c.json_body(payload), include_response)create_conversation#
create_conversation(*, payload: _T.CreateConversationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateConversation200, _Errors]
create_conversation(*, payload: _T.CreateConversationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateConversation200, _HttpClientResponse], _Errors]Create a conversation.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_conversation(self, *, payload: _T.CreateConversationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateConversation200, _Errors]: ...
@_t.overload
def create_conversation(self, *, payload: _T.CreateConversationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateConversation200, _HttpClientResponse], _Errors]: ...
def create_conversation(self, *, payload: _T.CreateConversationRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a conversation."""
return self._json(_CREATE_CONVERSATION, "/conversations", None, _c.json_body(payload), include_response)get_conversation#
get_conversation(conversation_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetConversation200, _Errors]
get_conversation(conversation_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetConversation200, _HttpClientResponse], _Errors]Get a conversation
| Parameter | Type | Description |
|---|---|---|
conversation_id | ||
include_response | = False |
@_t.overload
def get_conversation(self, conversation_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetConversation200, _Errors]: ...
@_t.overload
def get_conversation(self, conversation_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetConversation200, _HttpClientResponse], _Errors]: ...
def get_conversation(self, conversation_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a conversation"""
return self._json(_GET_CONVERSATION, _c.encoded_path("/conversations/{}", conversation_id), None, None, include_response)update_conversation#
update_conversation(conversation_id: str, *, payload: _T.UpdateConversationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateConversation200, _Errors]
update_conversation(conversation_id: str, *, payload: _T.UpdateConversationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateConversation200, _HttpClientResponse], _Errors]Update a conversation
| Parameter | Type | Description |
|---|---|---|
conversation_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_conversation(self, conversation_id: str, *, payload: _T.UpdateConversationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateConversation200, _Errors]: ...
@_t.overload
def update_conversation(self, conversation_id: str, *, payload: _T.UpdateConversationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateConversation200, _HttpClientResponse], _Errors]: ...
def update_conversation(self, conversation_id: str, *, payload: _T.UpdateConversationRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Update a conversation"""
return self._json(_UPDATE_CONVERSATION, _c.encoded_path("/conversations/{}", conversation_id), None, _c.json_body(payload), include_response)delete_conversation#
delete_conversation(conversation_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteConversation200, _Errors]
delete_conversation(conversation_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteConversation200, _HttpClientResponse], _Errors]Delete a conversation. Items in the conversation will not be deleted.
| Parameter | Type | Description |
|---|---|---|
conversation_id | ||
include_response | = False |
@_t.overload
def delete_conversation(self, conversation_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteConversation200, _Errors]: ...
@_t.overload
def delete_conversation(self, conversation_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteConversation200, _HttpClientResponse], _Errors]: ...
def delete_conversation(self, conversation_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a conversation. Items in the conversation will not be deleted."""
return self._json(_DELETE_CONVERSATION, _c.encoded_path("/conversations/{}", conversation_id), None, None, include_response)getsafetycase#
getsafetycase(id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getsafetycase200, _Errors]
getsafetycase(id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getsafetycase200, _HttpClientResponse], _Errors]Get a safety case by ID.
| Parameter | Type | Description |
|---|---|---|
id | ||
include_response | = False |
@_t.overload
def getsafetycase(self, id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getsafetycase200, _Errors]: ...
@_t.overload
def getsafetycase(self, id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getsafetycase200, _HttpClientResponse], _Errors]: ...
def getsafetycase(self, id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a safety case by ID."""
return self._json(_GETSAFETYCASE, _c.encoded_path("/safety/cases/{}", id), None, None, include_response)getprojectsafetyalert#
getprojectsafetyalert(id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getprojectsafetyalert200, _Errors]
getprojectsafetyalert(id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getprojectsafetyalert200, _HttpClientResponse], _Errors]Get a safety alert belonging to the authenticated API project.
| Parameter | Type | Description |
|---|---|---|
id | ||
include_response | = False |
@_t.overload
def getprojectsafetyalert(self, id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getprojectsafetyalert200, _Errors]: ...
@_t.overload
def getprojectsafetyalert(self, id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getprojectsafetyalert200, _HttpClientResponse], _Errors]: ...
def getprojectsafetyalert(self, id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a safety alert belonging to the authenticated API project."""
return self._json(_GETPROJECTSAFETYALERT, _c.encoded_path("/safety/alerts/{}", id), None, None, include_response)download_live_recording#
download_live_recording(session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]
download_live_recording(session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]Get Live session content
| Parameter | Type | Description |
|---|---|---|
session_id | ||
include_response | = False |
@_t.overload
def download_live_recording(self, session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]: ...
@_t.overload
def download_live_recording(self, session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]: ...
def download_live_recording(self, session_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get Live session content"""
return self._json(_DOWNLOAD_LIVE_RECORDING, _c.encoded_path("/live/sessions/{}/content", session_id), None, None, include_response)download_live_recording_stream#
download_live_recording_stream(session_id) -> _Stream[bytes, _HttpClientError]Get Live session content
| Parameter | Type | Description |
|---|---|---|
session_id | str |
Returns _Stream[bytes, _HttpClientError]
def download_live_recording_stream(self, session_id: str) -> _Stream[bytes, _HttpClientError]:
"""Get Live session content"""
return self._binary(_DOWNLOAD_LIVE_RECORDING_STREAM, _c.encoded_path("/live/sessions/{}/content", session_id), None, None)organization_decisionsusage#
organization_decisionsusage(*, params: _T.OrganizationDecisionsusageParams, include_response: _t.Literal[False] = False) -> _Effect[_T.OrganizationDecisionsusage200, _Errors]
organization_decisionsusage(*, params: _T.OrganizationDecisionsusageParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.OrganizationDecisionsusage200, _HttpClientResponse], _Errors]Get Decisions API usage details for the organization.
| Parameter | Type | Description |
|---|---|---|
params | ||
include_response | = False |
@_t.overload
def organization_decisionsusage(self, *, params: _T.OrganizationDecisionsusageParams, include_response: _t.Literal[False] = False) -> _Effect[_T.OrganizationDecisionsusage200, _Errors]: ...
@_t.overload
def organization_decisionsusage(self, *, params: _T.OrganizationDecisionsusageParams, include_response: _t.Literal[True]) -> _Effect[tuple[_T.OrganizationDecisionsusage200, _HttpClientResponse], _Errors]: ...
def organization_decisionsusage(self, *, params: _T.OrganizationDecisionsusageParams, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get Decisions API usage details for the organization."""
return self._json(_ORGANIZATION_DECISIONSUSAGE, "/organization/usage/decisions", params, None, include_response)listexternalstorageconfigurations#
listexternalstorageconfigurations(*, params: _T.ListexternalstorageconfigurationsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.Listexternalstorageconfigurations200, _Errors]
listexternalstorageconfigurations(*, params: _T.ListexternalstorageconfigurationsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Listexternalstorageconfigurations200, _HttpClientResponse], _Errors]List the organization's customer-managed external storage configurations.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def listexternalstorageconfigurations(self, *, params: _T.ListexternalstorageconfigurationsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.Listexternalstorageconfigurations200, _Errors]: ...
@_t.overload
def listexternalstorageconfigurations(self, *, params: _T.ListexternalstorageconfigurationsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Listexternalstorageconfigurations200, _HttpClientResponse], _Errors]: ...
def listexternalstorageconfigurations(self, *, params: _T.ListexternalstorageconfigurationsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List the organization's customer-managed external storage configurations."""
return self._json(_LISTEXTERNALSTORAGECONFIGURATIONS, "/organization/external_storage", params, None, include_response)createanexternalstorageconfiguration#
createanexternalstorageconfiguration(*, payload: _T.CreateanexternalstorageconfigurationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Createanexternalstorageconfiguration200, _Errors]
createanexternalstorageconfiguration(*, payload: _T.CreateanexternalstorageconfigurationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Createanexternalstorageconfiguration200, _HttpClientResponse], _Errors]Register one customer-managed external storage configuration.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def createanexternalstorageconfiguration(self, *, payload: _T.CreateanexternalstorageconfigurationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Createanexternalstorageconfiguration200, _Errors]: ...
@_t.overload
def createanexternalstorageconfiguration(self, *, payload: _T.CreateanexternalstorageconfigurationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Createanexternalstorageconfiguration200, _HttpClientResponse], _Errors]: ...
def createanexternalstorageconfiguration(self, *, payload: _T.CreateanexternalstorageconfigurationRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Register one customer-managed external storage configuration."""
return self._json(_CREATEANEXTERNALSTORAGECONFIGURATION, "/organization/external_storage", None, _c.json_body(payload), include_response)getanexternalstorageconfiguration#
getanexternalstorageconfiguration(external_storage_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getanexternalstorageconfiguration200, _Errors]
getanexternalstorageconfiguration(external_storage_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getanexternalstorageconfiguration200, _HttpClientResponse], _Errors]Get one customer-managed external storage configuration.
| Parameter | Type | Description |
|---|---|---|
external_storage_id | ||
include_response | = False |
@_t.overload
def getanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getanexternalstorageconfiguration200, _Errors]: ...
@_t.overload
def getanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getanexternalstorageconfiguration200, _HttpClientResponse], _Errors]: ...
def getanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get one customer-managed external storage configuration."""
return self._json(_GETANEXTERNALSTORAGECONFIGURATION, _c.encoded_path("/organization/external_storage/{}", external_storage_id), None, None, include_response)deleteanexternalstorageconfiguration#
deleteanexternalstorageconfiguration(external_storage_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Deleteanexternalstorageconfiguration200, _Errors]
deleteanexternalstorageconfiguration(external_storage_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Deleteanexternalstorageconfiguration200, _HttpClientResponse], _Errors]Disconnect a customer-managed external storage configuration. Removing the project's last configuration restores organization-default retention if customer-managed retention was active. Repeating a deletion also completes any interrupted retention update. Cloud storage is unchanged.
| Parameter | Type | Description |
|---|---|---|
external_storage_id | ||
include_response | = False |
@_t.overload
def deleteanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Deleteanexternalstorageconfiguration200, _Errors]: ...
@_t.overload
def deleteanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Deleteanexternalstorageconfiguration200, _HttpClientResponse], _Errors]: ...
def deleteanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Disconnect a customer-managed external storage configuration. Removing the project's last configuration restores organization-default retention if customer-managed retention was active. Repeating a deletion also completes any interrupted retention update. Cloud storage is unchanged."""
return self._json(_DELETEANEXTERNALSTORAGECONFIGURATION, _c.encoded_path("/organization/external_storage/{}", external_storage_id), None, None, include_response)validateanexternalstorageconfiguration#
validateanexternalstorageconfiguration(external_storage_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Validateanexternalstorageconfiguration200, _Errors]
validateanexternalstorageconfiguration(external_storage_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Validateanexternalstorageconfiguration200, _HttpClientResponse], _Errors]Validate one customer-managed external storage configuration.
| Parameter | Type | Description |
|---|---|---|
external_storage_id | ||
include_response | = False |
@_t.overload
def validateanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Validateanexternalstorageconfiguration200, _Errors]: ...
@_t.overload
def validateanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Validateanexternalstorageconfiguration200, _HttpClientResponse], _Errors]: ...
def validateanexternalstorageconfiguration(self, external_storage_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Validate one customer-managed external storage configuration."""
return self._json(_VALIDATEANEXTERNALSTORAGECONFIGURATION, _c.encoded_path("/organization/external_storage/{}/validate", external_storage_id), None, None, include_response)getorganizationspendlimit#
getorganizationspendlimit(*, include_response: _t.Literal[False] = False) -> _Effect[_T.Getorganizationspendlimit200, _Errors]
getorganizationspendlimit(*, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getorganizationspendlimit200, _HttpClientResponse], _Errors]Get the organization's hard spend limit.
| Parameter | Type | Description |
|---|---|---|
include_response | = False |
@_t.overload
def getorganizationspendlimit(self, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getorganizationspendlimit200, _Errors]: ...
@_t.overload
def getorganizationspendlimit(self, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getorganizationspendlimit200, _HttpClientResponse], _Errors]: ...
def getorganizationspendlimit(self, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get the organization's hard spend limit."""
return self._json(_GETORGANIZATIONSPENDLIMIT, "/organization/spend_limit", None, None, include_response)updateorganizationspendlimit#
updateorganizationspendlimit(*, payload: _T.UpdateorganizationspendlimitRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Updateorganizationspendlimit200, _Errors]
updateorganizationspendlimit(*, payload: _T.UpdateorganizationspendlimitRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Updateorganizationspendlimit200, _HttpClientResponse], _Errors]Create or replace the organization's hard spend limit.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def updateorganizationspendlimit(self, *, payload: _T.UpdateorganizationspendlimitRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Updateorganizationspendlimit200, _Errors]: ...
@_t.overload
def updateorganizationspendlimit(self, *, payload: _T.UpdateorganizationspendlimitRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Updateorganizationspendlimit200, _HttpClientResponse], _Errors]: ...
def updateorganizationspendlimit(self, *, payload: _T.UpdateorganizationspendlimitRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create or replace the organization's hard spend limit."""
return self._json(_UPDATEORGANIZATIONSPENDLIMIT, "/organization/spend_limit", None, _c.json_body(payload), include_response)deleteorganizationspendlimit#
deleteorganizationspendlimit(*, include_response: _t.Literal[False] = False) -> _Effect[_T.Deleteorganizationspendlimit200, _Errors]
deleteorganizationspendlimit(*, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Deleteorganizationspendlimit200, _HttpClientResponse], _Errors]Delete the organization's hard spend limit.
| Parameter | Type | Description |
|---|---|---|
include_response | = False |
@_t.overload
def deleteorganizationspendlimit(self, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Deleteorganizationspendlimit200, _Errors]: ...
@_t.overload
def deleteorganizationspendlimit(self, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Deleteorganizationspendlimit200, _HttpClientResponse], _Errors]: ...
def deleteorganizationspendlimit(self, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete the organization's hard spend limit."""
return self._json(_DELETEORGANIZATIONSPENDLIMIT, "/organization/spend_limit", None, None, include_response)getprojectspendlimit#
getprojectspendlimit(project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getprojectspendlimit200, _Errors]
getprojectspendlimit(project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getprojectspendlimit200, _HttpClientResponse], _Errors]Get a project's hard spend limit.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
include_response | = False |
@_t.overload
def getprojectspendlimit(self, project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Getprojectspendlimit200, _Errors]: ...
@_t.overload
def getprojectspendlimit(self, project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getprojectspendlimit200, _HttpClientResponse], _Errors]: ...
def getprojectspendlimit(self, project_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a project's hard spend limit."""
return self._json(_GETPROJECTSPENDLIMIT, _c.encoded_path("/organization/projects/{}/spend_limit", project_id), None, None, include_response)updateprojectspendlimit#
updateprojectspendlimit(project_id: str, *, payload: _T.UpdateprojectspendlimitRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Updateprojectspendlimit200, _Errors]
updateprojectspendlimit(project_id: str, *, payload: _T.UpdateprojectspendlimitRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Updateprojectspendlimit200, _HttpClientResponse], _Errors]Create or replace a project's hard spend limit.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
payload | ||
include_response | = False |
@_t.overload
def updateprojectspendlimit(self, project_id: str, *, payload: _T.UpdateprojectspendlimitRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Updateprojectspendlimit200, _Errors]: ...
@_t.overload
def updateprojectspendlimit(self, project_id: str, *, payload: _T.UpdateprojectspendlimitRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Updateprojectspendlimit200, _HttpClientResponse], _Errors]: ...
def updateprojectspendlimit(self, project_id: str, *, payload: _T.UpdateprojectspendlimitRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create or replace a project's hard spend limit."""
return self._json(_UPDATEPROJECTSPENDLIMIT, _c.encoded_path("/organization/projects/{}/spend_limit", project_id), None, _c.json_body(payload), include_response)deleteprojectspendlimit#
deleteprojectspendlimit(project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Deleteprojectspendlimit200, _Errors]
deleteprojectspendlimit(project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Deleteprojectspendlimit200, _HttpClientResponse], _Errors]Delete a project's hard spend limit.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
include_response | = False |
@_t.overload
def deleteprojectspendlimit(self, project_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.Deleteprojectspendlimit200, _Errors]: ...
@_t.overload
def deleteprojectspendlimit(self, project_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Deleteprojectspendlimit200, _HttpClientResponse], _Errors]: ...
def deleteprojectspendlimit(self, project_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a project's hard spend limit."""
return self._json(_DELETEPROJECTSPENDLIMIT, _c.encoded_path("/organization/projects/{}/spend_limit", project_id), None, None, include_response)createan_ap_ikeyforaserviceaccount#
createan_ap_ikeyforaserviceaccount(project_id: str, service_account_id: str, *, payload: _T.CreateanAPIkeyforaserviceaccountRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateanAPIkeyforaserviceaccount200, _Errors]
createan_ap_ikeyforaserviceaccount(project_id: str, service_account_id: str, *, payload: _T.CreateanAPIkeyforaserviceaccountRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateanAPIkeyforaserviceaccount200, _HttpClientResponse], _Errors]Creates an API key for a service account in the project.
| Parameter | Type | Description |
|---|---|---|
project_id | ||
service_account_id | ||
payload | ||
include_response | = False |
@_t.overload
def createan_ap_ikeyforaserviceaccount(self, project_id: str, service_account_id: str, *, payload: _T.CreateanAPIkeyforaserviceaccountRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateanAPIkeyforaserviceaccount200, _Errors]: ...
@_t.overload
def createan_ap_ikeyforaserviceaccount(self, project_id: str, service_account_id: str, *, payload: _T.CreateanAPIkeyforaserviceaccountRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateanAPIkeyforaserviceaccount200, _HttpClientResponse], _Errors]: ...
def createan_ap_ikeyforaserviceaccount(self, project_id: str, service_account_id: str, *, payload: _T.CreateanAPIkeyforaserviceaccountRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates an API key for a service account in the project."""
return self._json(_CREATEAN_AP_IKEYFORASERVICEACCOUNT, _c.encoded_path("/organization/projects/{}/service_accounts/{}/api_keys", project_id, service_account_id), None, _c.json_body(payload), include_response)createcontentprovenancecheck#
createcontentprovenancecheck(*, payload: _T.CreatecontentprovenancecheckRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.Createcontentprovenancecheck200, _Errors]
createcontentprovenancecheck(*, payload: _T.CreatecontentprovenancecheckRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Createcontentprovenancecheck200, _HttpClientResponse], _Errors]Check whether an image or audio file contains known OpenAI provenance signals. Learn more about content provenance.
If not_detected, it means the tool did not find supported signals in the uploaded file. The content could still have been generated by OpenAI if the metadata was stripped or has evidence of tampering, the watermark was degraded, it comes from a legacy generation model, or it was created before provenance signals were available. Content could also still be AI-generated by another company's model, which the tool currently does not detect.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def createcontentprovenancecheck(self, *, payload: _T.CreatecontentprovenancecheckRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.Createcontentprovenancecheck200, _Errors]: ...
@_t.overload
def createcontentprovenancecheck(self, *, payload: _T.CreatecontentprovenancecheckRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Createcontentprovenancecheck200, _HttpClientResponse], _Errors]: ...
def createcontentprovenancecheck(self, *, payload: _T.CreatecontentprovenancecheckRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Check whether an image or audio file contains known OpenAI provenance signals. [Learn more about content provenance](https://developers.openai.com/api/docs/guides/content-provenance).
If `not_detected`, it means the tool did not find supported signals in the uploaded file. The content could still have been generated by OpenAI if the metadata was stripped or has evidence of tampering, the watermark was degraded, it comes from a legacy generation model, or it was created before provenance signals were available. Content could also still be AI-generated by another company's model, which the tool currently does not detect."""
return self._json(_CREATECONTENTPROVENANCECHECK, "/content_provenance_checks", None, _c.form_body(payload), include_response)list_videos#
list_videos(*, params: _T.ListVideosParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVideos200, _Errors]
list_videos(*, params: _T.ListVideosParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVideos200, _HttpClientResponse], _Errors]List recently generated videos for the current project.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_videos(self, *, params: _T.ListVideosParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVideos200, _Errors]: ...
@_t.overload
def list_videos(self, *, params: _T.ListVideosParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVideos200, _HttpClientResponse], _Errors]: ...
def list_videos(self, *, params: _T.ListVideosParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List recently generated videos for the current project."""
return self._json(_LIST_VIDEOS, "/videos", params, None, include_response)create_video#
create_video(*, payload: _T.CreateVideoRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideo200, _Errors]
create_video(*, payload: _T.CreateVideoRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideo200, _HttpClientResponse], _Errors]Create a new video generation job from a prompt and optional reference assets.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_video(self, *, payload: _T.CreateVideoRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideo200, _Errors]: ...
@_t.overload
def create_video(self, *, payload: _T.CreateVideoRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideo200, _HttpClientResponse], _Errors]: ...
def create_video(self, *, payload: _T.CreateVideoRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a new video generation job from a prompt and optional reference assets."""
return self._json(_CREATE_VIDEO, "/videos", None, _c.form_body(payload), include_response)create_video_character#
create_video_character(*, payload: _T.CreateVideoCharacterRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideoCharacter200, _Errors]
create_video_character(*, payload: _T.CreateVideoCharacterRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideoCharacter200, _HttpClientResponse], _Errors]Create a character from an uploaded video.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_video_character(self, *, payload: _T.CreateVideoCharacterRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideoCharacter200, _Errors]: ...
@_t.overload
def create_video_character(self, *, payload: _T.CreateVideoCharacterRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideoCharacter200, _HttpClientResponse], _Errors]: ...
def create_video_character(self, *, payload: _T.CreateVideoCharacterRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a character from an uploaded video."""
return self._json(_CREATE_VIDEO_CHARACTER, "/videos/characters", None, _c.form_body(payload), include_response)get_video_character#
get_video_character(character_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVideoCharacter200, _Errors]
get_video_character(character_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVideoCharacter200, _HttpClientResponse], _Errors]Fetch a character.
| Parameter | Type | Description |
|---|---|---|
character_id | ||
include_response | = False |
@_t.overload
def get_video_character(self, character_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVideoCharacter200, _Errors]: ...
@_t.overload
def get_video_character(self, character_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVideoCharacter200, _HttpClientResponse], _Errors]: ...
def get_video_character(self, character_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Fetch a character."""
return self._json(_GET_VIDEO_CHARACTER, _c.encoded_path("/videos/characters/{}", character_id), None, None, include_response)create_video_edit#
create_video_edit(*, payload: _T.CreateVideoEditRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideoEdit200, _Errors]
create_video_edit(*, payload: _T.CreateVideoEditRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideoEdit200, _HttpClientResponse], _Errors]Create a new video generation job by editing a source video or existing generated video.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_video_edit(self, *, payload: _T.CreateVideoEditRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideoEdit200, _Errors]: ...
@_t.overload
def create_video_edit(self, *, payload: _T.CreateVideoEditRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideoEdit200, _HttpClientResponse], _Errors]: ...
def create_video_edit(self, *, payload: _T.CreateVideoEditRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a new video generation job by editing a source video or existing generated video."""
return self._json(_CREATE_VIDEO_EDIT, "/videos/edits", None, _c.form_body(payload), include_response)create_video_extend#
create_video_extend(*, payload: _T.CreateVideoExtendRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideoExtend200, _Errors]
create_video_extend(*, payload: _T.CreateVideoExtendRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideoExtend200, _HttpClientResponse], _Errors]Create an extension of a completed video.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_video_extend(self, *, payload: _T.CreateVideoExtendRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideoExtend200, _Errors]: ...
@_t.overload
def create_video_extend(self, *, payload: _T.CreateVideoExtendRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideoExtend200, _HttpClientResponse], _Errors]: ...
def create_video_extend(self, *, payload: _T.CreateVideoExtendRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create an extension of a completed video."""
return self._json(_CREATE_VIDEO_EXTEND, "/videos/extensions", None, _c.form_body(payload), include_response)get_video#
get_video(video_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVideo200, _Errors]
get_video(video_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVideo200, _HttpClientResponse], _Errors]Fetch the latest metadata for a generated video.
| Parameter | Type | Description |
|---|---|---|
video_id | ||
include_response | = False |
@_t.overload
def get_video(self, video_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetVideo200, _Errors]: ...
@_t.overload
def get_video(self, video_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetVideo200, _HttpClientResponse], _Errors]: ...
def get_video(self, video_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Fetch the latest metadata for a generated video."""
return self._json(_GET_VIDEO, _c.encoded_path("/videos/{}", video_id), None, None, include_response)delete_video#
delete_video(video_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVideo200, _Errors]
delete_video(video_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVideo200, _HttpClientResponse], _Errors]Permanently delete a completed or failed video and its stored assets.
| Parameter | Type | Description |
|---|---|---|
video_id | ||
include_response | = False |
@_t.overload
def delete_video(self, video_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVideo200, _Errors]: ...
@_t.overload
def delete_video(self, video_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVideo200, _HttpClientResponse], _Errors]: ...
def delete_video(self, video_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Permanently delete a completed or failed video and its stored assets."""
return self._json(_DELETE_VIDEO, _c.encoded_path("/videos/{}", video_id), None, None, include_response)retrieve_video_content#
retrieve_video_content(video_id: str, *, params: _T.RetrieveVideoContentParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]
retrieve_video_content(video_id: str, *, params: _T.RetrieveVideoContentParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]Download the generated video bytes or a derived preview asset.
Streams the rendered video content for the specified video job.
| Parameter | Type | Description |
|---|---|---|
video_id | ||
params | = None | |
include_response | = False |
@_t.overload
def retrieve_video_content(self, video_id: str, *, params: _T.RetrieveVideoContentParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]: ...
@_t.overload
def retrieve_video_content(self, video_id: str, *, params: _T.RetrieveVideoContentParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]: ...
def retrieve_video_content(self, video_id: str, *, params: _T.RetrieveVideoContentParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Download the generated video bytes or a derived preview asset.
Streams the rendered video content for the specified video job."""
return self._json(_RETRIEVE_VIDEO_CONTENT, _c.encoded_path("/videos/{}/content", video_id), params, None, include_response)retrieve_video_content_stream#
retrieve_video_content_stream(video_id, *, params=None) -> _Stream[bytes, _HttpClientError]Download the generated video bytes or a derived preview asset.
Streams the rendered video content for the specified video job.
| Parameter | Type | Description |
|---|---|---|
video_id | str | |
params | _T.RetrieveVideoContentParams | None = None |
Returns _Stream[bytes, _HttpClientError]
def retrieve_video_content_stream(self, video_id: str, *, params: _T.RetrieveVideoContentParams | None = None) -> _Stream[bytes, _HttpClientError]:
"""Download the generated video bytes or a derived preview asset.
Streams the rendered video content for the specified video job."""
return self._binary(_RETRIEVE_VIDEO_CONTENT_STREAM, _c.encoded_path("/videos/{}/content", video_id), params, None)create_video_remix#
create_video_remix(video_id: str, *, payload: _T.CreateVideoRemixRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideoRemix200, _Errors]
create_video_remix(video_id: str, *, payload: _T.CreateVideoRemixRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideoRemix200, _HttpClientResponse], _Errors]Create a remix of a completed video using a refreshed prompt.
| Parameter | Type | Description |
|---|---|---|
video_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_video_remix(self, video_id: str, *, payload: _T.CreateVideoRemixRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVideoRemix200, _Errors]: ...
@_t.overload
def create_video_remix(self, video_id: str, *, payload: _T.CreateVideoRemixRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVideoRemix200, _HttpClientResponse], _Errors]: ...
def create_video_remix(self, video_id: str, *, payload: _T.CreateVideoRemixRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a remix of a completed video using a refreshed prompt."""
return self._json(_CREATE_VIDEO_REMIX, _c.encoded_path("/videos/{}/remix", video_id), None, _c.form_body(payload), include_response)getinputtokencounts#
getinputtokencounts(*, payload: _T.GetinputtokencountsRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Getinputtokencounts200, _Errors]
getinputtokencounts(*, payload: _T.GetinputtokencountsRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getinputtokencounts200, _HttpClientResponse], _Errors]Returns input token counts of the request.
Returns an object with object set to response.input_tokens and an input_tokens count.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def getinputtokencounts(self, *, payload: _T.GetinputtokencountsRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Getinputtokencounts200, _Errors]: ...
@_t.overload
def getinputtokencounts(self, *, payload: _T.GetinputtokencountsRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Getinputtokencounts200, _HttpClientResponse], _Errors]: ...
def getinputtokencounts(self, *, payload: _T.GetinputtokencountsRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns input token counts of the request.
Returns an object with `object` set to `response.input_tokens` and an `input_tokens` count."""
return self._json(_GETINPUTTOKENCOUNTS, "/responses/input_tokens", None, _c.json_body(payload), include_response)compactconversation#
compactconversation(*, payload: _T.CompactconversationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Compactconversation200, _Errors]
compactconversation(*, payload: _T.CompactconversationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Compactconversation200, _HttpClientResponse], _Errors]Compact a conversation. Returns a compacted response object.
Learn when and how to compact long-running conversations in the conversation state guide. For ZDR-compatible compaction details, see Compaction (advanced).
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def compactconversation(self, *, payload: _T.CompactconversationRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.Compactconversation200, _Errors]: ...
@_t.overload
def compactconversation(self, *, payload: _T.CompactconversationRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.Compactconversation200, _HttpClientResponse], _Errors]: ...
def compactconversation(self, *, payload: _T.CompactconversationRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Compact a conversation. Returns a compacted response object.
Learn when and how to compact long-running conversations in the [conversation state guide](https://developers.openai.com/api/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](https://developers.openai.com/api/docs/guides/conversation-state#compaction-advanced)."""
return self._json(_COMPACTCONVERSATION, "/responses/compact", None, _c.json_body(payload), include_response)list_skills#
list_skills(*, params: _T.ListSkillsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListSkills200, _Errors]
list_skills(*, params: _T.ListSkillsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListSkills200, _HttpClientResponse], _Errors]List all skills for the current project.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_skills(self, *, params: _T.ListSkillsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListSkills200, _Errors]: ...
@_t.overload
def list_skills(self, *, params: _T.ListSkillsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListSkills200, _HttpClientResponse], _Errors]: ...
def list_skills(self, *, params: _T.ListSkillsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List all skills for the current project."""
return self._json(_LIST_SKILLS, "/skills", params, None, include_response)create_skill#
create_skill(*, payload: _T.CreateSkillRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateSkill200, _Errors]
create_skill(*, payload: _T.CreateSkillRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateSkill200, _HttpClientResponse], _Errors]Create a new skill.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_skill(self, *, payload: _T.CreateSkillRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateSkill200, _Errors]: ...
@_t.overload
def create_skill(self, *, payload: _T.CreateSkillRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateSkill200, _HttpClientResponse], _Errors]: ...
def create_skill(self, *, payload: _T.CreateSkillRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a new skill."""
return self._json(_CREATE_SKILL, "/skills", None, _c.form_body(payload), include_response)get_skill#
get_skill(skill_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetSkill200, _Errors]
get_skill(skill_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetSkill200, _HttpClientResponse], _Errors]Get a skill by its ID.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
include_response | = False |
@_t.overload
def get_skill(self, skill_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetSkill200, _Errors]: ...
@_t.overload
def get_skill(self, skill_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetSkill200, _HttpClientResponse], _Errors]: ...
def get_skill(self, skill_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a skill by its ID."""
return self._json(_GET_SKILL, _c.encoded_path("/skills/{}", skill_id), None, None, include_response)update_skill_default_version#
update_skill_default_version(skill_id: str, *, payload: _T.UpdateSkillDefaultVersionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateSkillDefaultVersion200, _Errors]
update_skill_default_version(skill_id: str, *, payload: _T.UpdateSkillDefaultVersionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateSkillDefaultVersion200, _HttpClientResponse], _Errors]Update the default version pointer for a skill.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_skill_default_version(self, skill_id: str, *, payload: _T.UpdateSkillDefaultVersionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateSkillDefaultVersion200, _Errors]: ...
@_t.overload
def update_skill_default_version(self, skill_id: str, *, payload: _T.UpdateSkillDefaultVersionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateSkillDefaultVersion200, _HttpClientResponse], _Errors]: ...
def update_skill_default_version(self, skill_id: str, *, payload: _T.UpdateSkillDefaultVersionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Update the default version pointer for a skill."""
return self._json(_UPDATE_SKILL_DEFAULT_VERSION, _c.encoded_path("/skills/{}", skill_id), None, _c.json_body(payload), include_response)delete_skill#
delete_skill(skill_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteSkill200, _Errors]
delete_skill(skill_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteSkill200, _HttpClientResponse], _Errors]Delete a skill by its ID.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
include_response | = False |
@_t.overload
def delete_skill(self, skill_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteSkill200, _Errors]: ...
@_t.overload
def delete_skill(self, skill_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteSkill200, _HttpClientResponse], _Errors]: ...
def delete_skill(self, skill_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a skill by its ID."""
return self._json(_DELETE_SKILL, _c.encoded_path("/skills/{}", skill_id), None, None, include_response)get_skill_content#
get_skill_content(skill_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]
get_skill_content(skill_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]Download a skill zip bundle by its ID.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
include_response | = False |
@_t.overload
def get_skill_content(self, skill_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]: ...
@_t.overload
def get_skill_content(self, skill_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]: ...
def get_skill_content(self, skill_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Download a skill zip bundle by its ID."""
return self._json(_GET_SKILL_CONTENT, _c.encoded_path("/skills/{}/content", skill_id), None, None, include_response)get_skill_content_stream#
get_skill_content_stream(skill_id) -> _Stream[bytes, _HttpClientError]Download a skill zip bundle by its ID.
| Parameter | Type | Description |
|---|---|---|
skill_id | str |
Returns _Stream[bytes, _HttpClientError]
def get_skill_content_stream(self, skill_id: str) -> _Stream[bytes, _HttpClientError]:
"""Download a skill zip bundle by its ID."""
return self._binary(_GET_SKILL_CONTENT_STREAM, _c.encoded_path("/skills/{}/content", skill_id), None, None)list_skill_versions#
list_skill_versions(skill_id: str, *, params: _T.ListSkillVersionsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListSkillVersions200, _Errors]
list_skill_versions(skill_id: str, *, params: _T.ListSkillVersionsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListSkillVersions200, _HttpClientResponse], _Errors]List skill versions for a skill.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_skill_versions(self, skill_id: str, *, params: _T.ListSkillVersionsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListSkillVersions200, _Errors]: ...
@_t.overload
def list_skill_versions(self, skill_id: str, *, params: _T.ListSkillVersionsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListSkillVersions200, _HttpClientResponse], _Errors]: ...
def list_skill_versions(self, skill_id: str, *, params: _T.ListSkillVersionsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List skill versions for a skill."""
return self._json(_LIST_SKILL_VERSIONS, _c.encoded_path("/skills/{}/versions", skill_id), params, None, include_response)create_skill_version#
create_skill_version(skill_id: str, *, payload: _T.CreateSkillVersionRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateSkillVersion200, _Errors]
create_skill_version(skill_id: str, *, payload: _T.CreateSkillVersionRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateSkillVersion200, _HttpClientResponse], _Errors]Create a new immutable skill version.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_skill_version(self, skill_id: str, *, payload: _T.CreateSkillVersionRequestFormData, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateSkillVersion200, _Errors]: ...
@_t.overload
def create_skill_version(self, skill_id: str, *, payload: _T.CreateSkillVersionRequestFormData, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateSkillVersion200, _HttpClientResponse], _Errors]: ...
def create_skill_version(self, skill_id: str, *, payload: _T.CreateSkillVersionRequestFormData, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a new immutable skill version."""
return self._json(_CREATE_SKILL_VERSION, _c.encoded_path("/skills/{}/versions", skill_id), None, _c.form_body(payload), include_response)get_skill_version#
get_skill_version(skill_id: str, version: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetSkillVersion200, _Errors]
get_skill_version(skill_id: str, version: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetSkillVersion200, _HttpClientResponse], _Errors]Get a specific skill version.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
version | ||
include_response | = False |
@_t.overload
def get_skill_version(self, skill_id: str, version: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetSkillVersion200, _Errors]: ...
@_t.overload
def get_skill_version(self, skill_id: str, version: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetSkillVersion200, _HttpClientResponse], _Errors]: ...
def get_skill_version(self, skill_id: str, version: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Get a specific skill version."""
return self._json(_GET_SKILL_VERSION, _c.encoded_path("/skills/{}/versions/{}", skill_id, version), None, None, include_response)delete_skill_version#
delete_skill_version(skill_id: str, version: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteSkillVersion200, _Errors]
delete_skill_version(skill_id: str, version: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteSkillVersion200, _HttpClientResponse], _Errors]Delete a skill version.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
version | ||
include_response | = False |
@_t.overload
def delete_skill_version(self, skill_id: str, version: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteSkillVersion200, _Errors]: ...
@_t.overload
def delete_skill_version(self, skill_id: str, version: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteSkillVersion200, _HttpClientResponse], _Errors]: ...
def delete_skill_version(self, skill_id: str, version: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a skill version."""
return self._json(_DELETE_SKILL_VERSION, _c.encoded_path("/skills/{}/versions/{}", skill_id, version), None, None, include_response)get_skill_version_content#
get_skill_version_content(skill_id: str, version: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]
get_skill_version_content(skill_id: str, version: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]Download a skill version zip bundle.
| Parameter | Type | Description |
|---|---|---|
skill_id | ||
version | ||
include_response | = False |
@_t.overload
def get_skill_version_content(self, skill_id: str, version: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]: ...
@_t.overload
def get_skill_version_content(self, skill_id: str, version: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]: ...
def get_skill_version_content(self, skill_id: str, version: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Download a skill version zip bundle."""
return self._json(_GET_SKILL_VERSION_CONTENT, _c.encoded_path("/skills/{}/versions/{}/content", skill_id, version), None, None, include_response)get_skill_version_content_stream#
get_skill_version_content_stream(skill_id, version) -> _Stream[bytes, _HttpClientError]Download a skill version zip bundle.
| Parameter | Type | Description |
|---|---|---|
skill_id | str | |
version | str |
Returns _Stream[bytes, _HttpClientError]
def get_skill_version_content_stream(self, skill_id: str, version: str) -> _Stream[bytes, _HttpClientError]:
"""Download a skill version zip bundle."""
return self._binary(_GET_SKILL_VERSION_CONTENT_STREAM, _c.encoded_path("/skills/{}/versions/{}/content", skill_id, version), None, None)cancel_chat_session_method#
cancel_chat_session_method(session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelChatSessionMethod200, _Errors]
cancel_chat_session_method(session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelChatSessionMethod200, _HttpClientResponse], _Errors]Cancel an active ChatKit session and return its most recent metadata.
Cancelling prevents new requests from using the issued client secret.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
include_response | = False |
@_t.overload
def cancel_chat_session_method(self, session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.CancelChatSessionMethod200, _Errors]: ...
@_t.overload
def cancel_chat_session_method(self, session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CancelChatSessionMethod200, _HttpClientResponse], _Errors]: ...
def cancel_chat_session_method(self, session_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Cancel an active ChatKit session and return its most recent metadata.
Cancelling prevents new requests from using the issued client secret."""
return self._json(_CANCEL_CHAT_SESSION_METHOD, _c.encoded_path("/chatkit/sessions/{}/cancel", session_id), None, None, include_response)create_chat_session_method#
create_chat_session_method(*, payload: _T.CreateChatSessionMethodRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateChatSessionMethod200, _Errors]
create_chat_session_method(*, payload: _T.CreateChatSessionMethodRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateChatSessionMethod200, _HttpClientResponse], _Errors]Create a ChatKit session.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_chat_session_method(self, *, payload: _T.CreateChatSessionMethodRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateChatSessionMethod200, _Errors]: ...
@_t.overload
def create_chat_session_method(self, *, payload: _T.CreateChatSessionMethodRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateChatSessionMethod200, _HttpClientResponse], _Errors]: ...
def create_chat_session_method(self, *, payload: _T.CreateChatSessionMethodRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Create a ChatKit session."""
return self._json(_CREATE_CHAT_SESSION_METHOD, "/chatkit/sessions", None, _c.json_body(payload), include_response)list_thread_items_method#
list_thread_items_method(thread_id: str, *, params: _T.ListThreadItemsMethodParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListThreadItemsMethod200, _Errors]
list_thread_items_method(thread_id: str, *, params: _T.ListThreadItemsMethodParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListThreadItemsMethod200, _HttpClientResponse], _Errors]List items that belong to a ChatKit thread.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_thread_items_method(self, thread_id: str, *, params: _T.ListThreadItemsMethodParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListThreadItemsMethod200, _Errors]: ...
@_t.overload
def list_thread_items_method(self, thread_id: str, *, params: _T.ListThreadItemsMethodParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListThreadItemsMethod200, _HttpClientResponse], _Errors]: ...
def list_thread_items_method(self, thread_id: str, *, params: _T.ListThreadItemsMethodParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List items that belong to a ChatKit thread."""
return self._json(_LIST_THREAD_ITEMS_METHOD, _c.encoded_path("/chatkit/threads/{}/items", thread_id), params, None, include_response)get_thread_method#
get_thread_method(thread_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetThreadMethod200, _Errors]
get_thread_method(thread_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetThreadMethod200, _HttpClientResponse], _Errors]Retrieve a ChatKit thread by its identifier.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
include_response | = False |
@_t.overload
def get_thread_method(self, thread_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.GetThreadMethod200, _Errors]: ...
@_t.overload
def get_thread_method(self, thread_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.GetThreadMethod200, _HttpClientResponse], _Errors]: ...
def get_thread_method(self, thread_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieve a ChatKit thread by its identifier."""
return self._json(_GET_THREAD_METHOD, _c.encoded_path("/chatkit/threads/{}", thread_id), None, None, include_response)delete_thread_method#
delete_thread_method(thread_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteThreadMethod200, _Errors]
delete_thread_method(thread_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteThreadMethod200, _HttpClientResponse], _Errors]Delete a ChatKit thread along with its items and stored attachments.
| Parameter | Type | Description |
|---|---|---|
thread_id | ||
include_response | = False |
@_t.overload
def delete_thread_method(self, thread_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteThreadMethod200, _Errors]: ...
@_t.overload
def delete_thread_method(self, thread_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteThreadMethod200, _HttpClientResponse], _Errors]: ...
def delete_thread_method(self, thread_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Delete a ChatKit thread along with its items and stored attachments."""
return self._json(_DELETE_THREAD_METHOD, _c.encoded_path("/chatkit/threads/{}", thread_id), None, None, include_response)list_threads_method#
list_threads_method(*, params: _T.ListThreadsMethodParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListThreadsMethod200, _Errors]
list_threads_method(*, params: _T.ListThreadsMethodParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListThreadsMethod200, _HttpClientResponse], _Errors]List ChatKit threads with optional pagination and user filters.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_threads_method(self, *, params: _T.ListThreadsMethodParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListThreadsMethod200, _Errors]: ...
@_t.overload
def list_threads_method(self, *, params: _T.ListThreadsMethodParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListThreadsMethod200, _HttpClientResponse], _Errors]: ...
def list_threads_method(self, *, params: _T.ListThreadsMethodParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""List ChatKit threads with optional pagination and user filters."""
return self._json(_LIST_THREADS_METHOD, "/chatkit/threads", params, None, include_response)create_decision#
create_decision(*, payload: _T.CreateDecisionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateDecision200, _PlainErrors]
create_decision(*, payload: _T.CreateDecisionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateDecision200, _HttpClientResponse], _PlainErrors]Use this endpoint to ask classification or scoring questions about the same input. You’ll get the answers back in the order you asked the questions.
For text, you can pass a string. You can also send user messages containing input_text and input_image parts, with up to 128 images per request. Images can be base64 data URLs or publicly accessible HTTP(S) URLs. File IDs aren’t accepted. Other message roles, function calls, files, audio, and item references aren’t supported.
Sometimes a question returns a refusal instead of an answer. The result has type refusal and includes the question’s name, or null if you didn’t give it one.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_decision(self, *, payload: _T.CreateDecisionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateDecision200, _PlainErrors]: ...
@_t.overload
def create_decision(self, *, payload: _T.CreateDecisionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateDecision200, _HttpClientResponse], _PlainErrors]: ...
def create_decision(self, *, payload: _T.CreateDecisionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _PlainErrors]:
"""Use this endpoint to ask classification or scoring questions about the same input. You’ll get the answers back in the order you asked the questions.
For text, you can pass a string. You can also send user messages containing `input_text` and `input_image` parts, with up to 128 images per request. Images can be base64 data URLs or publicly accessible HTTP(S) URLs. File IDs aren’t accepted. Other message roles, function calls, files, audio, and item references aren’t supported.
Sometimes a question returns a refusal instead of an answer. The result has type `refusal` and includes the question’s name, or `null` if you didn’t give it one."""
return self._json(_CREATE_DECISION, "/decisions", None, _c.json_body(payload), include_response)list_agent_environments#
list_agent_environments(*, params: _T.ListAgentEnvironmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentEnvironments200, _Errors]
list_agent_environments(*, params: _T.ListAgentEnvironmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentEnvironments200, _HttpClientResponse], _Errors]Lists OpenAI-hosted environments owned by the authenticated principal. Requires access to the prewarming beta.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_agent_environments(self, *, params: _T.ListAgentEnvironmentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentEnvironments200, _Errors]: ...
@_t.overload
def list_agent_environments(self, *, params: _T.ListAgentEnvironmentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentEnvironments200, _HttpClientResponse], _Errors]: ...
def list_agent_environments(self, *, params: _T.ListAgentEnvironmentsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists OpenAI-hosted environments owned by the authenticated principal. Requires access to the prewarming beta."""
return self._json(_LIST_AGENT_ENVIRONMENTS, "/agents/environments", params, None, include_response)create_agent_environment#
create_agent_environment(*, payload: _T.CreateAgentEnvironmentRequestJson, params: _T.CreateAgentEnvironmentParams2 | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgentEnvironment201, _Errors]
create_agent_environment(*, payload: _T.CreateAgentEnvironmentRequestJson, params: _T.CreateAgentEnvironmentParams2 | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgentEnvironment201, _HttpClientResponse], _Errors]Creates an OpenAI-hosted environment before creating a session. Requires access to the prewarming beta.
| Parameter | Type | Description |
|---|---|---|
payload | ||
params | = None | |
include_response | = False |
@_t.overload
def create_agent_environment(self, *, payload: _T.CreateAgentEnvironmentRequestJson, params: _T.CreateAgentEnvironmentParams2 | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgentEnvironment201, _Errors]: ...
@_t.overload
def create_agent_environment(self, *, payload: _T.CreateAgentEnvironmentRequestJson, params: _T.CreateAgentEnvironmentParams2 | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgentEnvironment201, _HttpClientResponse], _Errors]: ...
def create_agent_environment(self, *, payload: _T.CreateAgentEnvironmentRequestJson, params: _T.CreateAgentEnvironmentParams2 | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates an OpenAI-hosted environment before creating a session. Requires access to the prewarming beta."""
return self._json(_CREATE_AGENT_ENVIRONMENT, "/agents/environments", params, _c.json_body(payload), include_response)retrieve_agent_environment#
retrieve_agent_environment(environment_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentEnvironment200, _Errors]
retrieve_agent_environment(environment_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentEnvironment200, _HttpClientResponse], _Errors]Retrieves an execution environment's connection status and safe installed metadata. See environment lifecycle.
| Parameter | Type | Description |
|---|---|---|
environment_id | ||
include_response | = False |
@_t.overload
def retrieve_agent_environment(self, environment_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentEnvironment200, _Errors]: ...
@_t.overload
def retrieve_agent_environment(self, environment_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentEnvironment200, _HttpClientResponse], _Errors]: ...
def retrieve_agent_environment(self, environment_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves an execution environment's connection status and safe installed metadata. See [environment lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle)."""
return self._json(_RETRIEVE_AGENT_ENVIRONMENT, _c.encoded_path("/agents/environments/{}", environment_id), None, None, include_response)list_agent_environment_files#
list_agent_environment_files(environment_id: str, *, params: _T.ListAgentEnvironmentFilesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentEnvironmentFiles200, _Errors]
list_agent_environment_files(environment_id: str, *, params: _T.ListAgentEnvironmentFilesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentEnvironmentFiles200, _HttpClientResponse], _Errors]Lists live files on a connected execution environment with optional directory filtering and opaque cursor pagination. See environment files.
| Parameter | Type | Description |
|---|---|---|
environment_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_environment_files(self, environment_id: str, *, params: _T.ListAgentEnvironmentFilesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentEnvironmentFiles200, _Errors]: ...
@_t.overload
def list_agent_environment_files(self, environment_id: str, *, params: _T.ListAgentEnvironmentFilesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentEnvironmentFiles200, _HttpClientResponse], _Errors]: ...
def list_agent_environment_files(self, environment_id: str, *, params: _T.ListAgentEnvironmentFilesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists live files on a connected execution environment with optional directory filtering and opaque cursor pagination. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files)."""
return self._json(_LIST_AGENT_ENVIRONMENT_FILES, _c.encoded_path("/agents/environments/{}/files", environment_id), params, None, include_response)create_agent_environment_file#
create_agent_environment_file(environment_id: str, *, payload: _T.CreateAgentEnvironmentFileRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgentEnvironmentFile201, _Errors]
create_agent_environment_file(environment_id: str, *, payload: _T.CreateAgentEnvironmentFileRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgentEnvironmentFile201, _HttpClientResponse], _Errors]Copies inline bytes or a Files API file into a connected execution environment. See environment files.
| Parameter | Type | Description |
|---|---|---|
environment_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_agent_environment_file(self, environment_id: str, *, payload: _T.CreateAgentEnvironmentFileRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgentEnvironmentFile201, _Errors]: ...
@_t.overload
def create_agent_environment_file(self, environment_id: str, *, payload: _T.CreateAgentEnvironmentFileRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgentEnvironmentFile201, _HttpClientResponse], _Errors]: ...
def create_agent_environment_file(self, environment_id: str, *, payload: _T.CreateAgentEnvironmentFileRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Copies inline bytes or a Files API file into a connected execution environment. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files)."""
return self._json(_CREATE_AGENT_ENVIRONMENT_FILE, _c.encoded_path("/agents/environments/{}/files", environment_id), None, _c.json_body(payload), include_response)list_agent_session_subagents#
list_agent_session_subagents(session_id: str, *, params: _T.ListAgentSessionSubagentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionSubagents200, _Errors]
list_agent_session_subagents(session_id: str, *, params: _T.ListAgentSessionSubagentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionSubagents200, _HttpClientResponse], _Errors]Lists subagents in a session, including nested and closed subagents. See subagent workflows.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_subagents(self, session_id: str, *, params: _T.ListAgentSessionSubagentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionSubagents200, _Errors]: ...
@_t.overload
def list_agent_session_subagents(self, session_id: str, *, params: _T.ListAgentSessionSubagentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionSubagents200, _HttpClientResponse], _Errors]: ...
def list_agent_session_subagents(self, session_id: str, *, params: _T.ListAgentSessionSubagentsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists subagents in a session, including nested and closed subagents. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent)."""
return self._json(_LIST_AGENT_SESSION_SUBAGENTS, _c.encoded_path("/agents/sessions/{}/subagents", session_id), params, None, include_response)retrieve_agent_session_subagent#
retrieve_agent_session_subagent(session_id: str, subagent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSessionSubagent200, _Errors]
retrieve_agent_session_subagent(session_id: str, subagent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSessionSubagent200, _HttpClientResponse], _Errors]Retrieves a subagent belonging to this session. See subagent workflows.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
subagent_id | ||
include_response | = False |
@_t.overload
def retrieve_agent_session_subagent(self, session_id: str, subagent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSessionSubagent200, _Errors]: ...
@_t.overload
def retrieve_agent_session_subagent(self, session_id: str, subagent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSessionSubagent200, _HttpClientResponse], _Errors]: ...
def retrieve_agent_session_subagent(self, session_id: str, subagent_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a subagent belonging to this session. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent)."""
return self._json(_RETRIEVE_AGENT_SESSION_SUBAGENT, _c.encoded_path("/agents/sessions/{}/subagents/{}", session_id, subagent_id), None, None, include_response)list_agent_session_subagent_items#
list_agent_session_subagent_items(session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionSubagentItems200, _Errors]
list_agent_session_subagent_items(session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionSubagentItems200, _HttpClientResponse], _Errors]Lists this subagent's own items across all of its turns. See subagent workflows.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
subagent_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_subagent_items(self, session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionSubagentItems200, _Errors]: ...
@_t.overload
def list_agent_session_subagent_items(self, session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionSubagentItems200, _HttpClientResponse], _Errors]: ...
def list_agent_session_subagent_items(self, session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists this subagent's own items across all of its turns. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent)."""
return self._json(_LIST_AGENT_SESSION_SUBAGENT_ITEMS, _c.encoded_path("/agents/sessions/{}/subagents/{}/items", session_id, subagent_id), params, None, include_response)list_agent_session_subagent_turns#
list_agent_session_subagent_turns(session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentTurnsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionSubagentTurns200, _Errors]
list_agent_session_subagent_turns(session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentTurnsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionSubagentTurns200, _HttpClientResponse], _Errors]Lists all turns of this subagent, including turns after a resume. See subagent workflows.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
subagent_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_subagent_turns(self, session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentTurnsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionSubagentTurns200, _Errors]: ...
@_t.overload
def list_agent_session_subagent_turns(self, session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentTurnsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionSubagentTurns200, _HttpClientResponse], _Errors]: ...
def list_agent_session_subagent_turns(self, session_id: str, subagent_id: str, *, params: _T.ListAgentSessionSubagentTurnsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists all turns of this subagent, including turns after a resume. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent)."""
return self._json(_LIST_AGENT_SESSION_SUBAGENT_TURNS, _c.encoded_path("/agents/sessions/{}/subagents/{}/turns", session_id, subagent_id), params, None, include_response)retrieve_agent_session_subagent_turn#
retrieve_agent_session_subagent_turn(session_id: str, subagent_id: str, turn_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSessionSubagentTurn200, _Errors]
retrieve_agent_session_subagent_turn(session_id: str, subagent_id: str, turn_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSessionSubagentTurn200, _HttpClientResponse], _Errors]Retrieves a turn belonging to this subagent. See subagent workflows.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
subagent_id | ||
turn_id | ||
include_response | = False |
@_t.overload
def retrieve_agent_session_subagent_turn(self, session_id: str, subagent_id: str, turn_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSessionSubagentTurn200, _Errors]: ...
@_t.overload
def retrieve_agent_session_subagent_turn(self, session_id: str, subagent_id: str, turn_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSessionSubagentTurn200, _HttpClientResponse], _Errors]: ...
def retrieve_agent_session_subagent_turn(self, session_id: str, subagent_id: str, turn_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a turn belonging to this subagent. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent)."""
return self._json(_RETRIEVE_AGENT_SESSION_SUBAGENT_TURN, _c.encoded_path("/agents/sessions/{}/subagents/{}/turns/{}", session_id, subagent_id, turn_id), None, None, include_response)list_agent_session_subagent_turn_items#
list_agent_session_subagent_turn_items(session_id: str, subagent_id: str, turn_id: str, *, params: _T.ListAgentSessionSubagentTurnItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionSubagentTurnItems200, _Errors]
list_agent_session_subagent_turn_items(session_id: str, subagent_id: str, turn_id: str, *, params: _T.ListAgentSessionSubagentTurnItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionSubagentTurnItems200, _HttpClientResponse], _Errors]Lists items belonging to one turn of this subagent. See subagent workflows.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
subagent_id | ||
turn_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_subagent_turn_items(self, session_id: str, subagent_id: str, turn_id: str, *, params: _T.ListAgentSessionSubagentTurnItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionSubagentTurnItems200, _Errors]: ...
@_t.overload
def list_agent_session_subagent_turn_items(self, session_id: str, subagent_id: str, turn_id: str, *, params: _T.ListAgentSessionSubagentTurnItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionSubagentTurnItems200, _HttpClientResponse], _Errors]: ...
def list_agent_session_subagent_turn_items(self, session_id: str, subagent_id: str, turn_id: str, *, params: _T.ListAgentSessionSubagentTurnItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists items belonging to one turn of this subagent. See [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent)."""
return self._json(_LIST_AGENT_SESSION_SUBAGENT_TURN_ITEMS, _c.encoded_path("/agents/sessions/{}/subagents/{}/turns/{}/items", session_id, subagent_id, turn_id), params, None, include_response)list_agents#
list_agents(*, params: _T.ListAgentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgents200, _Errors]
list_agents(*, params: _T.ListAgentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgents200, _HttpClientResponse], _Errors]Lists reusable agents in the current project. See agent configuration.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_agents(self, *, params: _T.ListAgentsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgents200, _Errors]: ...
@_t.overload
def list_agents(self, *, params: _T.ListAgentsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgents200, _HttpClientResponse], _Errors]: ...
def list_agents(self, *, params: _T.ListAgentsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists reusable agents in the current project. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration)."""
return self._json(_LIST_AGENTS, "/agents", params, None, include_response)create_agent#
create_agent(*, payload: _T.CreateAgentRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgent201, _Errors]
create_agent(*, payload: _T.CreateAgentRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgent201, _HttpClientResponse], _Errors]Creates a reusable agent without storing credentials. See agent configuration.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_agent(self, *, payload: _T.CreateAgentRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgent201, _Errors]: ...
@_t.overload
def create_agent(self, *, payload: _T.CreateAgentRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgent201, _HttpClientResponse], _Errors]: ...
def create_agent(self, *, payload: _T.CreateAgentRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a reusable agent without storing credentials. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration)."""
return self._json(_CREATE_AGENT, "/agents", None, _c.json_body(payload), include_response)retrieve_agent#
retrieve_agent(agent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgent200, _Errors]
retrieve_agent(agent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgent200, _HttpClientResponse], _Errors]Retrieves a reusable agent by ID. See agent configuration.
| Parameter | Type | Description |
|---|---|---|
agent_id | ||
include_response | = False |
@_t.overload
def retrieve_agent(self, agent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgent200, _Errors]: ...
@_t.overload
def retrieve_agent(self, agent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgent200, _HttpClientResponse], _Errors]: ...
def retrieve_agent(self, agent_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a reusable agent by ID. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration)."""
return self._json(_RETRIEVE_AGENT, _c.encoded_path("/agents/{}", agent_id), None, None, include_response)update_agent#
update_agent(agent_id: str, *, payload: _T.UpdateAgentRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateAgent200, _Errors]
update_agent(agent_id: str, *, payload: _T.UpdateAgentRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateAgent200, _HttpClientResponse], _Errors]Updates a reusable agent. See agent configuration.
| Parameter | Type | Description |
|---|---|---|
agent_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_agent(self, agent_id: str, *, payload: _T.UpdateAgentRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateAgent200, _Errors]: ...
@_t.overload
def update_agent(self, agent_id: str, *, payload: _T.UpdateAgentRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateAgent200, _HttpClientResponse], _Errors]: ...
def update_agent(self, agent_id: str, *, payload: _T.UpdateAgentRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates a reusable agent. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration)."""
return self._json(_UPDATE_AGENT, _c.encoded_path("/agents/{}", agent_id), None, _c.json_body(payload), include_response)delete_agent#
delete_agent(agent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAgent200, _Errors]
delete_agent(agent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAgent200, _HttpClientResponse], _Errors]Deletes a reusable agent. See agent configuration.
| Parameter | Type | Description |
|---|---|---|
agent_id | ||
include_response | = False |
@_t.overload
def delete_agent(self, agent_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAgent200, _Errors]: ...
@_t.overload
def delete_agent(self, agent_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAgent200, _HttpClientResponse], _Errors]: ...
def delete_agent(self, agent_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a reusable agent. See [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration)."""
return self._json(_DELETE_AGENT, _c.encoded_path("/agents/{}", agent_id), None, None, include_response)list_agent_environment_templates#
list_agent_environment_templates(*, params: _T.ListAgentEnvironmentTemplatesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentEnvironmentTemplates200, _Errors]
list_agent_environment_templates(*, params: _T.ListAgentEnvironmentTemplatesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentEnvironmentTemplates200, _HttpClientResponse], _Errors]Lists reusable environment templates without returning confidential values. See reusing a hosted setup.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_agent_environment_templates(self, *, params: _T.ListAgentEnvironmentTemplatesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentEnvironmentTemplates200, _Errors]: ...
@_t.overload
def list_agent_environment_templates(self, *, params: _T.ListAgentEnvironmentTemplatesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentEnvironmentTemplates200, _HttpClientResponse], _Errors]: ...
def list_agent_environment_templates(self, *, params: _T.ListAgentEnvironmentTemplatesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists reusable environment templates without returning confidential values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup)."""
return self._json(_LIST_AGENT_ENVIRONMENT_TEMPLATES, "/agents/environments/templates", params, None, include_response)create_agent_environment_template#
create_agent_environment_template(*, payload: _T.CreateAgentEnvironmentTemplateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgentEnvironmentTemplate201, _Errors]
create_agent_environment_template(*, payload: _T.CreateAgentEnvironmentTemplateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgentEnvironmentTemplate201, _HttpClientResponse], _Errors]Creates reusable environment configuration without returning confidential setup commands or environment values. See reusing a hosted setup.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_agent_environment_template(self, *, payload: _T.CreateAgentEnvironmentTemplateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgentEnvironmentTemplate201, _Errors]: ...
@_t.overload
def create_agent_environment_template(self, *, payload: _T.CreateAgentEnvironmentTemplateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgentEnvironmentTemplate201, _HttpClientResponse], _Errors]: ...
def create_agent_environment_template(self, *, payload: _T.CreateAgentEnvironmentTemplateRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates reusable environment configuration without returning confidential setup commands or environment values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup)."""
return self._json(_CREATE_AGENT_ENVIRONMENT_TEMPLATE, "/agents/environments/templates", None, _c.json_body(payload), include_response)retrieve_agent_environment_template#
retrieve_agent_environment_template(environment_template_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentEnvironmentTemplate200, _Errors]
retrieve_agent_environment_template(environment_template_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentEnvironmentTemplate200, _HttpClientResponse], _Errors]Retrieves reusable environment configuration without returning confidential values. See reusing a hosted setup.
| Parameter | Type | Description |
|---|---|---|
environment_template_id | ||
include_response | = False |
@_t.overload
def retrieve_agent_environment_template(self, environment_template_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentEnvironmentTemplate200, _Errors]: ...
@_t.overload
def retrieve_agent_environment_template(self, environment_template_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentEnvironmentTemplate200, _HttpClientResponse], _Errors]: ...
def retrieve_agent_environment_template(self, environment_template_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves reusable environment configuration without returning confidential values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup)."""
return self._json(_RETRIEVE_AGENT_ENVIRONMENT_TEMPLATE, _c.encoded_path("/agents/environments/templates/{}", environment_template_id), None, None, include_response)update_agent_environment_template#
update_agent_environment_template(environment_template_id: str, *, payload: _T.UpdateAgentEnvironmentTemplateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateAgentEnvironmentTemplate200, _Errors]
update_agent_environment_template(environment_template_id: str, *, payload: _T.UpdateAgentEnvironmentTemplateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateAgentEnvironmentTemplate200, _HttpClientResponse], _Errors]Updates reusable environment configuration without returning confidential values. See reusing a hosted setup.
| Parameter | Type | Description |
|---|---|---|
environment_template_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_agent_environment_template(self, environment_template_id: str, *, payload: _T.UpdateAgentEnvironmentTemplateRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateAgentEnvironmentTemplate200, _Errors]: ...
@_t.overload
def update_agent_environment_template(self, environment_template_id: str, *, payload: _T.UpdateAgentEnvironmentTemplateRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateAgentEnvironmentTemplate200, _HttpClientResponse], _Errors]: ...
def update_agent_environment_template(self, environment_template_id: str, *, payload: _T.UpdateAgentEnvironmentTemplateRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates reusable environment configuration without returning confidential values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup)."""
return self._json(_UPDATE_AGENT_ENVIRONMENT_TEMPLATE, _c.encoded_path("/agents/environments/templates/{}", environment_template_id), None, _c.json_body(payload), include_response)delete_agent_environment_template#
delete_agent_environment_template(environment_template_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAgentEnvironmentTemplate200, _Errors]
delete_agent_environment_template(environment_template_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAgentEnvironmentTemplate200, _HttpClientResponse], _Errors]Deletes reusable environment configuration and all confidential template inputs. See reusing a hosted setup.
| Parameter | Type | Description |
|---|---|---|
environment_template_id | ||
include_response | = False |
@_t.overload
def delete_agent_environment_template(self, environment_template_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAgentEnvironmentTemplate200, _Errors]: ...
@_t.overload
def delete_agent_environment_template(self, environment_template_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAgentEnvironmentTemplate200, _HttpClientResponse], _Errors]: ...
def delete_agent_environment_template(self, environment_template_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes reusable environment configuration and all confidential template inputs. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup)."""
return self._json(_DELETE_AGENT_ENVIRONMENT_TEMPLATE, _c.encoded_path("/agents/environments/templates/{}", environment_template_id), None, None, include_response)list_agent_sessions#
list_agent_sessions(*, params: _T.ListAgentSessionsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessions200, _Errors]
list_agent_sessions(*, params: _T.ListAgentSessionsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessions200, _HttpClientResponse], _Errors]Lists managed agent sessions using ID-based pagination and the requested sort order. See managing sessions.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_agent_sessions(self, *, params: _T.ListAgentSessionsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessions200, _Errors]: ...
@_t.overload
def list_agent_sessions(self, *, params: _T.ListAgentSessionsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessions200, _HttpClientResponse], _Errors]: ...
def list_agent_sessions(self, *, params: _T.ListAgentSessionsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists managed agent sessions using ID-based pagination and the requested sort order. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage)."""
return self._json(_LIST_AGENT_SESSIONS, "/agents/sessions", params, None, include_response)create_agent_session#
create_agent_session(*, payload: _T.CreateAgentSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgentSession201, _Errors]
create_agent_session(*, payload: _T.CreateAgentSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgentSession201, _HttpClientResponse], _Errors]Creates a managed agent session, optionally submits initial input, and returns the session or streams its events when stream is true. See running sessions.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_agent_session(self, *, payload: _T.CreateAgentSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateAgentSession201, _Errors]: ...
@_t.overload
def create_agent_session(self, *, payload: _T.CreateAgentSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateAgentSession201, _HttpClientResponse], _Errors]: ...
def create_agent_session(self, *, payload: _T.CreateAgentSessionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a managed agent session, optionally submits initial input, and returns the session or streams its events when stream is true. See [running sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions)."""
return self._json(_CREATE_AGENT_SESSION, "/agents/sessions", None, _c.json_body(payload), include_response)create_agent_session_sse#
create_agent_session_sse(*, payload) -> _Stream[_sse.DataEvent[_T.CreateAgentSession201Sse], _SseErrors]Creates a managed agent session, optionally submits initial input, and returns the session or streams its events when stream is true. See running sessions.
| Parameter | Type | Description |
|---|---|---|
payload | _T.CreateAgentSessionRequestJson |
Returns _Stream[_sse.DataEvent[_T.CreateAgentSession201Sse], _SseErrors]
def create_agent_session_sse(self, *, payload: _T.CreateAgentSessionRequestJson) -> _Stream[_sse.DataEvent[_T.CreateAgentSession201Sse], _SseErrors]:
"""Creates a managed agent session, optionally submits initial input, and returns the session or streams its events when stream is true. See [running sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions)."""
return self._sse(_CREATE_AGENT_SESSION_SSE, "/agents/sessions", None, _c.json_body(payload), CreateAgentSession201Sse)retrieve_agent_session#
retrieve_agent_session(session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSession200, _Errors]
retrieve_agent_session(session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSession200, _HttpClientResponse], _Errors]Retrieves the current state of a managed agent session. See managing sessions.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
include_response | = False |
@_t.overload
def retrieve_agent_session(self, session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSession200, _Errors]: ...
@_t.overload
def retrieve_agent_session(self, session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSession200, _HttpClientResponse], _Errors]: ...
def retrieve_agent_session(self, session_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves the current state of a managed agent session. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage)."""
return self._json(_RETRIEVE_AGENT_SESSION, _c.encoded_path("/agents/sessions/{}", session_id), None, None, include_response)update_agent_session#
update_agent_session(session_id: str, *, payload: _T.UpdateAgentSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateAgentSession200, _Errors]
update_agent_session(session_id: str, *, payload: _T.UpdateAgentSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateAgentSession200, _HttpClientResponse], _Errors]Updates session metadata, model, reasoning effort, or service tier. Model settings apply to subsequent turns. Omitted fields are unchanged. See managing sessions.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_agent_session(self, session_id: str, *, payload: _T.UpdateAgentSessionRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateAgentSession200, _Errors]: ...
@_t.overload
def update_agent_session(self, session_id: str, *, payload: _T.UpdateAgentSessionRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateAgentSession200, _HttpClientResponse], _Errors]: ...
def update_agent_session(self, session_id: str, *, payload: _T.UpdateAgentSessionRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates session metadata, model, reasoning effort, or service tier. Model settings apply to subsequent turns. Omitted fields are unchanged. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage)."""
return self._json(_UPDATE_AGENT_SESSION, _c.encoded_path("/agents/sessions/{}", session_id), None, _c.json_body(payload), include_response)delete_agent_session#
delete_agent_session(session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAgentSession200, _Errors]
delete_agent_session(session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAgentSession200, _HttpClientResponse], _Errors]Removes a managed agent session from the public API and returns a deletion confirmation. If backend execution has ended, deletion can cancel a still-open public turn and abandon unpublished outputs. Running execution must be cancelled first. Physical cleanup may continue asynchronously. See managing sessions.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
include_response | = False |
@_t.overload
def delete_agent_session(self, session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAgentSession200, _Errors]: ...
@_t.overload
def delete_agent_session(self, session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAgentSession200, _HttpClientResponse], _Errors]: ...
def delete_agent_session(self, session_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Removes a managed agent session from the public API and returns a deletion confirmation. If backend execution has ended, deletion can cancel a still-open public turn and abandon unpublished outputs. Running execution must be cancelled first. Physical cleanup may continue asynchronously. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage)."""
return self._json(_DELETE_AGENT_SESSION, _c.encoded_path("/agents/sessions/{}", session_id), None, None, include_response)list_agent_session_artifacts#
list_agent_session_artifacts(session_id: str, *, params: _T.ListAgentSessionArtifactsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionArtifacts200, _Errors]
list_agent_session_artifacts(session_id: str, *, params: _T.ListAgentSessionArtifactsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionArtifacts200, _HttpClientResponse], _Errors]Lists immutable artifacts published by completed hosted session turns. See session artifacts.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_artifacts(self, session_id: str, *, params: _T.ListAgentSessionArtifactsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionArtifacts200, _Errors]: ...
@_t.overload
def list_agent_session_artifacts(self, session_id: str, *, params: _T.ListAgentSessionArtifactsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionArtifacts200, _HttpClientResponse], _Errors]: ...
def list_agent_session_artifacts(self, session_id: str, *, params: _T.ListAgentSessionArtifactsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists immutable artifacts published by completed hosted session turns. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts)."""
return self._json(_LIST_AGENT_SESSION_ARTIFACTS, _c.encoded_path("/agents/sessions/{}/artifacts", session_id), params, None, include_response)retrieve_agent_session_artifact#
retrieve_agent_session_artifact(session_id: str, artifact_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSessionArtifact200, _Errors]
retrieve_agent_session_artifact(session_id: str, artifact_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSessionArtifact200, _HttpClientResponse], _Errors]Retrieves immutable metadata for one durable session artifact. See session artifacts.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
artifact_id | ||
include_response | = False |
@_t.overload
def retrieve_agent_session_artifact(self, session_id: str, artifact_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSessionArtifact200, _Errors]: ...
@_t.overload
def retrieve_agent_session_artifact(self, session_id: str, artifact_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSessionArtifact200, _HttpClientResponse], _Errors]: ...
def retrieve_agent_session_artifact(self, session_id: str, artifact_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves immutable metadata for one durable session artifact. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts)."""
return self._json(_RETRIEVE_AGENT_SESSION_ARTIFACT, _c.encoded_path("/agents/sessions/{}/artifacts/{}", session_id, artifact_id), None, None, include_response)delete_agent_session_artifact#
delete_agent_session_artifact(session_id: str, artifact_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAgentSessionArtifact200, _Errors]
delete_agent_session_artifact(session_id: str, artifact_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAgentSessionArtifact200, _HttpClientResponse], _Errors]Deletes an immutable session artifact without deleting its live environment file or original Files API object. See session artifacts.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
artifact_id | ||
include_response | = False |
@_t.overload
def delete_agent_session_artifact(self, session_id: str, artifact_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteAgentSessionArtifact200, _Errors]: ...
@_t.overload
def delete_agent_session_artifact(self, session_id: str, artifact_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteAgentSessionArtifact200, _HttpClientResponse], _Errors]: ...
def delete_agent_session_artifact(self, session_id: str, artifact_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes an immutable session artifact without deleting its live environment file or original Files API object. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts)."""
return self._json(_DELETE_AGENT_SESSION_ARTIFACT, _c.encoded_path("/agents/sessions/{}/artifacts/{}", session_id, artifact_id), None, None, include_response)retrieve_agent_session_artifact_content#
retrieve_agent_session_artifact_content(session_id: str, artifact_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]
retrieve_agent_session_artifact_content(session_id: str, artifact_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]Downloads immutable session artifact bytes after the execution environment expires. See session artifacts.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
artifact_id | ||
include_response | = False |
@_t.overload
def retrieve_agent_session_artifact_content(self, session_id: str, artifact_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[bytes, _Errors]: ...
@_t.overload
def retrieve_agent_session_artifact_content(self, session_id: str, artifact_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[bytes, _HttpClientResponse], _Errors]: ...
def retrieve_agent_session_artifact_content(self, session_id: str, artifact_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Downloads immutable session artifact bytes after the execution environment expires. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts)."""
return self._json(_RETRIEVE_AGENT_SESSION_ARTIFACT_CONTENT, _c.encoded_path("/agents/sessions/{}/artifacts/{}/content", session_id, artifact_id), None, None, include_response)retrieve_agent_session_artifact_content_stream#
retrieve_agent_session_artifact_content_stream(session_id, artifact_id) -> _Stream[bytes, _HttpClientError]Downloads immutable session artifact bytes after the execution environment expires. See session artifacts.
| Parameter | Type | Description |
|---|---|---|
session_id | str | |
artifact_id | str |
Returns _Stream[bytes, _HttpClientError]
def retrieve_agent_session_artifact_content_stream(self, session_id: str, artifact_id: str) -> _Stream[bytes, _HttpClientError]:
"""Downloads immutable session artifact bytes after the execution environment expires. See [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts)."""
return self._binary(_RETRIEVE_AGENT_SESSION_ARTIFACT_CONTENT_STREAM, _c.encoded_path("/agents/sessions/{}/artifacts/{}/content", session_id, artifact_id), None, None)list_agent_session_events#
list_agent_session_events(session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
list_agent_session_events(session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]Streams live events for an agent session. See session events.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
include_response | = False |
@_t.overload
def list_agent_session_events(self, session_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def list_agent_session_events(self, session_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def list_agent_session_events(self, session_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Streams live events for an agent session. See [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events)."""
return self._json(_LIST_AGENT_SESSION_EVENTS, _c.encoded_path("/agents/sessions/{}/events", session_id), None, None, include_response)list_agent_session_events_sse#
list_agent_session_events_sse(session_id) -> _Stream[_sse.DataEvent[_T.ListAgentSessionEvents200Sse], _SseErrors]Streams live events for an agent session. See session events.
| Parameter | Type | Description |
|---|---|---|
session_id | str |
Returns _Stream[_sse.DataEvent[_T.ListAgentSessionEvents200Sse], _SseErrors]
def list_agent_session_events_sse(self, session_id: str) -> _Stream[_sse.DataEvent[_T.ListAgentSessionEvents200Sse], _SseErrors]:
"""Streams live events for an agent session. See [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events)."""
return self._sse(_LIST_AGENT_SESSION_EVENTS_SSE, _c.encoded_path("/agents/sessions/{}/events", session_id), None, None, ListAgentSessionEvents200Sse)create_agent_session_events#
create_agent_session_events(session_id: str, *, payload: _T.CreateAgentSessionEventsRequestJson, params: _T.CreateAgentSessionEventsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]
create_agent_session_events(session_id: str, *, payload: _T.CreateAgentSessionEventsRequestJson, params: _T.CreateAgentSessionEventsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]Submits message, cancellation, tool-result, or computer-use approval-response events to a managed agent session. Cancellation can recover a still-open turn whose backend execution has ended by marking it cancelled and abandoning unpublished outputs. Saved results, published files, and existing terminal outcomes are preserved. HTTP 202 confirms acceptance, not durable completion. See session events.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
payload | ||
params | = None | |
include_response | = False |
@_t.overload
def create_agent_session_events(self, session_id: str, *, payload: _T.CreateAgentSessionEventsRequestJson, params: _T.CreateAgentSessionEventsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[None, _Errors]: ...
@_t.overload
def create_agent_session_events(self, session_id: str, *, payload: _T.CreateAgentSessionEventsRequestJson, params: _T.CreateAgentSessionEventsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[None, _HttpClientResponse], _Errors]: ...
def create_agent_session_events(self, session_id: str, *, payload: _T.CreateAgentSessionEventsRequestJson, params: _T.CreateAgentSessionEventsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Submits message, cancellation, tool-result, or computer-use approval-response events to a managed agent session. Cancellation can recover a still-open turn whose backend execution has ended by marking it cancelled and abandoning unpublished outputs. Saved results, published files, and existing terminal outcomes are preserved. HTTP 202 confirms acceptance, not durable completion. See [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events)."""
return self._json(_CREATE_AGENT_SESSION_EVENTS, _c.encoded_path("/agents/sessions/{}/events", session_id), params, _c.json_body(payload), include_response)list_agent_session_items#
list_agent_session_items(session_id: str, *, params: _T.ListAgentSessionItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionItems200, _Errors]
list_agent_session_items(session_id: str, *, params: _T.ListAgentSessionItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionItems200, _HttpClientResponse], _Errors]Lists items produced by the session's root agent, including its interactions with subagents. Each subagent has its own item history. See inspecting agent output.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_items(self, session_id: str, *, params: _T.ListAgentSessionItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionItems200, _Errors]: ...
@_t.overload
def list_agent_session_items(self, session_id: str, *, params: _T.ListAgentSessionItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionItems200, _HttpClientResponse], _Errors]: ...
def list_agent_session_items(self, session_id: str, *, params: _T.ListAgentSessionItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists items produced by the session's root agent, including its interactions with subagents. Each subagent has its own item history. See [inspecting agent output](https://developers.openai.com/api/docs/guides/agents-api/observability)."""
return self._json(_LIST_AGENT_SESSION_ITEMS, _c.encoded_path("/agents/sessions/{}/items", session_id), params, None, include_response)list_agent_session_traces#
list_agent_session_traces(session_id: str, *, params: _T.ListAgentSessionTracesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionTraces200, _Errors]
list_agent_session_traces(session_id: str, *, params: _T.ListAgentSessionTracesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionTraces200, _HttpClientResponse], _Errors]Lists published root-turn traces as OTLP JSON, ordered by turn creation time and ID. Unpublished traces are skipped. Each page returns data available when read; it does not wait for late traces. Trace reads and the JSON response are limited to 16 MiB per request. If the limit is exceeded, request fewer traces.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_traces(self, session_id: str, *, params: _T.ListAgentSessionTracesParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionTraces200, _Errors]: ...
@_t.overload
def list_agent_session_traces(self, session_id: str, *, params: _T.ListAgentSessionTracesParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionTraces200, _HttpClientResponse], _Errors]: ...
def list_agent_session_traces(self, session_id: str, *, params: _T.ListAgentSessionTracesParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists published root-turn traces as OTLP JSON, ordered by turn creation time and ID. Unpublished traces are skipped. Each page returns data available when read; it does not wait for late traces. Trace reads and the JSON response are limited to 16 MiB per request. If the limit is exceeded, request fewer traces."""
return self._json(_LIST_AGENT_SESSION_TRACES, _c.encoded_path("/agents/sessions/{}/traces", session_id), params, None, include_response)list_agent_session_turns#
list_agent_session_turns(session_id: str, *, params: _T.ListAgentSessionTurnsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionTurns200, _Errors]
list_agent_session_turns(session_id: str, *, params: _T.ListAgentSessionTurnsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionTurns200, _HttpClientResponse], _Errors]Lists turns by creation time and turn ID. The after cursor is exclusive in the selected order. See session turns.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_turns(self, session_id: str, *, params: _T.ListAgentSessionTurnsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionTurns200, _Errors]: ...
@_t.overload
def list_agent_session_turns(self, session_id: str, *, params: _T.ListAgentSessionTurnsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionTurns200, _HttpClientResponse], _Errors]: ...
def list_agent_session_turns(self, session_id: str, *, params: _T.ListAgentSessionTurnsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists turns by creation time and turn ID. The after cursor is exclusive in the selected order. See [session turns](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-session-turns)."""
return self._json(_LIST_AGENT_SESSION_TURNS, _c.encoded_path("/agents/sessions/{}/turns", session_id), params, None, include_response)retrieve_agent_session_turn#
retrieve_agent_session_turn(session_id: str, turn_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSessionTurn200, _Errors]
retrieve_agent_session_turn(session_id: str, turn_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSessionTurn200, _HttpClientResponse], _Errors]Retrieves a turn's current status, timestamps, usage, and error. Returns 404 if the turn does not belong to the session. See session turns.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
turn_id | ||
include_response | = False |
@_t.overload
def retrieve_agent_session_turn(self, session_id: str, turn_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveAgentSessionTurn200, _Errors]: ...
@_t.overload
def retrieve_agent_session_turn(self, session_id: str, turn_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveAgentSessionTurn200, _HttpClientResponse], _Errors]: ...
def retrieve_agent_session_turn(self, session_id: str, turn_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a turn's current status, timestamps, usage, and error. Returns 404 if the turn does not belong to the session. See [session turns](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-session-turns)."""
return self._json(_RETRIEVE_AGENT_SESSION_TURN, _c.encoded_path("/agents/sessions/{}/turns/{}", session_id, turn_id), None, None, include_response)list_agent_session_turn_items#
list_agent_session_turn_items(session_id: str, turn_id: str, *, params: _T.ListAgentSessionTurnItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionTurnItems200, _Errors]
list_agent_session_turn_items(session_id: str, turn_id: str, *, params: _T.ListAgentSessionTurnItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionTurnItems200, _HttpClientResponse], _Errors]Lists items belonging to one root-agent turn, including its interactions with subagents. See inspecting agent output.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
turn_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_agent_session_turn_items(self, session_id: str, turn_id: str, *, params: _T.ListAgentSessionTurnItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListAgentSessionTurnItems200, _Errors]: ...
@_t.overload
def list_agent_session_turn_items(self, session_id: str, turn_id: str, *, params: _T.ListAgentSessionTurnItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListAgentSessionTurnItems200, _HttpClientResponse], _Errors]: ...
def list_agent_session_turn_items(self, session_id: str, turn_id: str, *, params: _T.ListAgentSessionTurnItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists items belonging to one root-agent turn, including its interactions with subagents. See [inspecting agent output](https://developers.openai.com/api/docs/guides/agents-api/observability)."""
return self._json(_LIST_AGENT_SESSION_TURN_ITEMS, _c.encoded_path("/agents/sessions/{}/turns/{}/items", session_id, turn_id), params, None, include_response)list_vaults#
list_vaults(*, params: _T.ListVaultsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVaults200, _Errors]
list_vaults(*, params: _T.ListVaultsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVaults200, _HttpClientResponse], _Errors]Lists vaults using ID-based pagination. See vaults.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_vaults(self, *, params: _T.ListVaultsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVaults200, _Errors]: ...
@_t.overload
def list_vaults(self, *, params: _T.ListVaultsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVaults200, _HttpClientResponse], _Errors]: ...
def list_vaults(self, *, params: _T.ListVaultsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists vaults using ID-based pagination. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_LIST_VAULTS, "/vaults", params, None, include_response)create_vault#
create_vault(*, payload: _T.CreateVaultRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVault201, _Errors]
create_vault(*, payload: _T.CreateVaultRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVault201, _HttpClientResponse], _Errors]Creates a vault for the current project. See vaults.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_vault(self, *, payload: _T.CreateVaultRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVault201, _Errors]: ...
@_t.overload
def create_vault(self, *, payload: _T.CreateVaultRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVault201, _HttpClientResponse], _Errors]: ...
def create_vault(self, *, payload: _T.CreateVaultRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a vault for the current project. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_CREATE_VAULT, "/vaults", None, _c.json_body(payload), include_response)retrieve_vault#
retrieve_vault(vault_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveVault200, _Errors]
retrieve_vault(vault_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveVault200, _HttpClientResponse], _Errors]Retrieves a vault by its ID. See vaults.
| Parameter | Type | Description |
|---|---|---|
vault_id | ||
include_response | = False |
@_t.overload
def retrieve_vault(self, vault_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveVault200, _Errors]: ...
@_t.overload
def retrieve_vault(self, vault_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveVault200, _HttpClientResponse], _Errors]: ...
def retrieve_vault(self, vault_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a vault by its ID. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_RETRIEVE_VAULT, _c.encoded_path("/vaults/{}", vault_id), None, None, include_response)update_vault#
update_vault(vault_id: str, *, payload: _T.UpdateVaultRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateVault200, _Errors]
update_vault(vault_id: str, *, payload: _T.UpdateVaultRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateVault200, _HttpClientResponse], _Errors]Updates the name or metadata of an active vault. Omitted fields remain unchanged. See vaults.
| Parameter | Type | Description |
|---|---|---|
vault_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_vault(self, vault_id: str, *, payload: _T.UpdateVaultRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateVault200, _Errors]: ...
@_t.overload
def update_vault(self, vault_id: str, *, payload: _T.UpdateVaultRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateVault200, _HttpClientResponse], _Errors]: ...
def update_vault(self, vault_id: str, *, payload: _T.UpdateVaultRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates the name or metadata of an active vault. Omitted fields remain unchanged. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_UPDATE_VAULT, _c.encoded_path("/vaults/{}", vault_id), None, _c.json_body(payload), include_response)delete_vault#
delete_vault(vault_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVault200, _Errors]
delete_vault(vault_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVault200, _HttpClientResponse], _Errors]Deletes a vault and all its credentials. See vaults.
| Parameter | Type | Description |
|---|---|---|
vault_id | ||
include_response | = False |
@_t.overload
def delete_vault(self, vault_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVault200, _Errors]: ...
@_t.overload
def delete_vault(self, vault_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVault200, _HttpClientResponse], _Errors]: ...
def delete_vault(self, vault_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a vault and all its credentials. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_DELETE_VAULT, _c.encoded_path("/vaults/{}", vault_id), None, None, include_response)list_vault_credentials#
list_vault_credentials(vault_id: str, *, params: _T.ListVaultCredentialsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVaultCredentials200, _Errors]
list_vault_credentials(vault_id: str, *, params: _T.ListVaultCredentialsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVaultCredentials200, _HttpClientResponse], _Errors]Lists a vault's credentials using ID-based pagination without returning secret values. See vaults.
| Parameter | Type | Description |
|---|---|---|
vault_id | ||
params | = None | |
include_response | = False |
@_t.overload
def list_vault_credentials(self, vault_id: str, *, params: _T.ListVaultCredentialsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListVaultCredentials200, _Errors]: ...
@_t.overload
def list_vault_credentials(self, vault_id: str, *, params: _T.ListVaultCredentialsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListVaultCredentials200, _HttpClientResponse], _Errors]: ...
def list_vault_credentials(self, vault_id: str, *, params: _T.ListVaultCredentialsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Lists a vault's credentials using ID-based pagination without returning secret values. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_LIST_VAULT_CREDENTIALS, _c.encoded_path("/vaults/{}/credentials", vault_id), params, None, include_response)create_vault_credential#
create_vault_credential(vault_id: str, *, payload: _T.CreateVaultCredentialRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVaultCredential201, _Errors]
create_vault_credential(vault_id: str, *, payload: _T.CreateVaultCredentialRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVaultCredential201, _HttpClientResponse], _Errors]Creates a vault credential. Secret values are write-only and are never returned. See vaults.
| Parameter | Type | Description |
|---|---|---|
vault_id | ||
payload | ||
include_response | = False |
@_t.overload
def create_vault_credential(self, vault_id: str, *, payload: _T.CreateVaultCredentialRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateVaultCredential201, _Errors]: ...
@_t.overload
def create_vault_credential(self, vault_id: str, *, payload: _T.CreateVaultCredentialRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateVaultCredential201, _HttpClientResponse], _Errors]: ...
def create_vault_credential(self, vault_id: str, *, payload: _T.CreateVaultCredentialRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a vault credential. Secret values are write-only and are never returned. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_CREATE_VAULT_CREDENTIAL, _c.encoded_path("/vaults/{}/credentials", vault_id), None, _c.json_body(payload), include_response)retrieve_vault_credential#
retrieve_vault_credential(vault_id: str, credential_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveVaultCredential200, _Errors]
retrieve_vault_credential(vault_id: str, credential_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveVaultCredential200, _HttpClientResponse], _Errors]Retrieves vault credential metadata without returning secret values. See vaults.
| Parameter | Type | Description |
|---|---|---|
vault_id | ||
credential_id | ||
include_response | = False |
@_t.overload
def retrieve_vault_credential(self, vault_id: str, credential_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveVaultCredential200, _Errors]: ...
@_t.overload
def retrieve_vault_credential(self, vault_id: str, credential_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveVaultCredential200, _HttpClientResponse], _Errors]: ...
def retrieve_vault_credential(self, vault_id: str, credential_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves vault credential metadata without returning secret values. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_RETRIEVE_VAULT_CREDENTIAL, _c.encoded_path("/vaults/{}/credentials/{}", vault_id, credential_id), None, None, include_response)rotate_vault_credential#
rotate_vault_credential(vault_id: str, credential_id: str, *, payload: _T.RotateVaultCredentialRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.RotateVaultCredential200, _Errors]
rotate_vault_credential(vault_id: str, credential_id: str, *, payload: _T.RotateVaultCredentialRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RotateVaultCredential200, _HttpClientResponse], _Errors]Updates credential metadata or rotates its write-only secret. See vaults.
| Parameter | Type | Description |
|---|---|---|
vault_id | ||
credential_id | ||
payload | ||
include_response | = False |
@_t.overload
def rotate_vault_credential(self, vault_id: str, credential_id: str, *, payload: _T.RotateVaultCredentialRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.RotateVaultCredential200, _Errors]: ...
@_t.overload
def rotate_vault_credential(self, vault_id: str, credential_id: str, *, payload: _T.RotateVaultCredentialRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RotateVaultCredential200, _HttpClientResponse], _Errors]: ...
def rotate_vault_credential(self, vault_id: str, credential_id: str, *, payload: _T.RotateVaultCredentialRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates credential metadata or rotates its write-only secret. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_ROTATE_VAULT_CREDENTIAL, _c.encoded_path("/vaults/{}/credentials/{}", vault_id, credential_id), None, _c.json_body(payload), include_response)delete_vault_credential#
delete_vault_credential(vault_id: str, credential_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVaultCredential200, _Errors]
delete_vault_credential(vault_id: str, credential_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVaultCredential200, _HttpClientResponse], _Errors]Deletes a vault credential. See vaults.
| Parameter | Type | Description |
|---|---|---|
vault_id | ||
credential_id | ||
include_response | = False |
@_t.overload
def delete_vault_credential(self, vault_id: str, credential_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteVaultCredential200, _Errors]: ...
@_t.overload
def delete_vault_credential(self, vault_id: str, credential_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteVaultCredential200, _HttpClientResponse], _Errors]: ...
def delete_vault_credential(self, vault_id: str, credential_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a vault credential. See [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults)."""
return self._json(_DELETE_VAULT_CREDENTIAL, _c.encoded_path("/vaults/{}/credentials/{}", vault_id, credential_id), None, None, include_response)list_webhook_endpoints#
list_webhook_endpoints(*, params: _T.ListWebhookEndpointsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListWebhookEndpoints200, _Errors]
list_webhook_endpoints(*, params: _T.ListWebhookEndpointsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListWebhookEndpoints200, _HttpClientResponse], _Errors]Returns webhook endpoints for the authenticated project in newest-first order.
| Parameter | Type | Description |
|---|---|---|
params | = None | |
include_response | = False |
@_t.overload
def list_webhook_endpoints(self, *, params: _T.ListWebhookEndpointsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.ListWebhookEndpoints200, _Errors]: ...
@_t.overload
def list_webhook_endpoints(self, *, params: _T.ListWebhookEndpointsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListWebhookEndpoints200, _HttpClientResponse], _Errors]: ...
def list_webhook_endpoints(self, *, params: _T.ListWebhookEndpointsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns webhook endpoints for the authenticated project in newest-first order."""
return self._json(_LIST_WEBHOOK_ENDPOINTS, "/webhook_endpoints", params, None, include_response)create_webhook_endpoint#
create_webhook_endpoint(*, payload: _T.CreateWebhookEndpointRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateWebhookEndpoint200, _Errors]
create_webhook_endpoint(*, payload: _T.CreateWebhookEndpointRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateWebhookEndpoint200, _HttpClientResponse], _Errors]Creates a webhook endpoint for the authenticated project.
| Parameter | Type | Description |
|---|---|---|
payload | ||
include_response | = False |
@_t.overload
def create_webhook_endpoint(self, *, payload: _T.CreateWebhookEndpointRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.CreateWebhookEndpoint200, _Errors]: ...
@_t.overload
def create_webhook_endpoint(self, *, payload: _T.CreateWebhookEndpointRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.CreateWebhookEndpoint200, _HttpClientResponse], _Errors]: ...
def create_webhook_endpoint(self, *, payload: _T.CreateWebhookEndpointRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a webhook endpoint for the authenticated project."""
return self._json(_CREATE_WEBHOOK_ENDPOINT, "/webhook_endpoints", None, _c.json_body(payload), include_response)retrieve_webhook_endpoint#
retrieve_webhook_endpoint(webhook_endpoint_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveWebhookEndpoint200, _Errors]
retrieve_webhook_endpoint(webhook_endpoint_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveWebhookEndpoint200, _HttpClientResponse], _Errors]Retrieves a webhook endpoint for the authenticated project.
| Parameter | Type | Description |
|---|---|---|
webhook_endpoint_id | ||
include_response | = False |
@_t.overload
def retrieve_webhook_endpoint(self, webhook_endpoint_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.RetrieveWebhookEndpoint200, _Errors]: ...
@_t.overload
def retrieve_webhook_endpoint(self, webhook_endpoint_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RetrieveWebhookEndpoint200, _HttpClientResponse], _Errors]: ...
def retrieve_webhook_endpoint(self, webhook_endpoint_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a webhook endpoint for the authenticated project."""
return self._json(_RETRIEVE_WEBHOOK_ENDPOINT, _c.encoded_path("/webhook_endpoints/{}", webhook_endpoint_id), None, None, include_response)update_webhook_endpoint#
update_webhook_endpoint(webhook_endpoint_id: str, *, payload: _T.UpdateWebhookEndpointRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateWebhookEndpoint200, _Errors]
update_webhook_endpoint(webhook_endpoint_id: str, *, payload: _T.UpdateWebhookEndpointRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateWebhookEndpoint200, _HttpClientResponse], _Errors]Updates a webhook endpoint for the authenticated project.
| Parameter | Type | Description |
|---|---|---|
webhook_endpoint_id | ||
payload | ||
include_response | = False |
@_t.overload
def update_webhook_endpoint(self, webhook_endpoint_id: str, *, payload: _T.UpdateWebhookEndpointRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.UpdateWebhookEndpoint200, _Errors]: ...
@_t.overload
def update_webhook_endpoint(self, webhook_endpoint_id: str, *, payload: _T.UpdateWebhookEndpointRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.UpdateWebhookEndpoint200, _HttpClientResponse], _Errors]: ...
def update_webhook_endpoint(self, webhook_endpoint_id: str, *, payload: _T.UpdateWebhookEndpointRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Updates a webhook endpoint for the authenticated project."""
return self._json(_UPDATE_WEBHOOK_ENDPOINT, _c.encoded_path("/webhook_endpoints/{}", webhook_endpoint_id), None, _c.json_body(payload), include_response)delete_webhook_endpoint#
delete_webhook_endpoint(webhook_endpoint_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteWebhookEndpoint200, _Errors]
delete_webhook_endpoint(webhook_endpoint_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteWebhookEndpoint200, _HttpClientResponse], _Errors]Deletes a webhook endpoint for the authenticated project.
| Parameter | Type | Description |
|---|---|---|
webhook_endpoint_id | ||
include_response | = False |
@_t.overload
def delete_webhook_endpoint(self, webhook_endpoint_id: str, *, include_response: _t.Literal[False] = False) -> _Effect[_T.DeleteWebhookEndpoint200, _Errors]: ...
@_t.overload
def delete_webhook_endpoint(self, webhook_endpoint_id: str, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.DeleteWebhookEndpoint200, _HttpClientResponse], _Errors]: ...
def delete_webhook_endpoint(self, webhook_endpoint_id: str, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a webhook endpoint for the authenticated project."""
return self._json(_DELETE_WEBHOOK_ENDPOINT, _c.encoded_path("/webhook_endpoints/{}", webhook_endpoint_id), None, None, include_response)rotate_webhook_endpoint_signing_secret#
rotate_webhook_endpoint_signing_secret(webhook_endpoint_id: str, *, payload: _T.RotateWebhookEndpointSigningSecretRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.RotateWebhookEndpointSigningSecret200, _Errors]
rotate_webhook_endpoint_signing_secret(webhook_endpoint_id: str, *, payload: _T.RotateWebhookEndpointSigningSecretRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RotateWebhookEndpointSigningSecret200, _HttpClientResponse], _Errors]Rotates the signing secret for a webhook endpoint in the authenticated project.
| Parameter | Type | Description |
|---|---|---|
webhook_endpoint_id | ||
payload | ||
include_response | = False |
@_t.overload
def rotate_webhook_endpoint_signing_secret(self, webhook_endpoint_id: str, *, payload: _T.RotateWebhookEndpointSigningSecretRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.RotateWebhookEndpointSigningSecret200, _Errors]: ...
@_t.overload
def rotate_webhook_endpoint_signing_secret(self, webhook_endpoint_id: str, *, payload: _T.RotateWebhookEndpointSigningSecretRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.RotateWebhookEndpointSigningSecret200, _HttpClientResponse], _Errors]: ...
def rotate_webhook_endpoint_signing_secret(self, webhook_endpoint_id: str, *, payload: _T.RotateWebhookEndpointSigningSecretRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Rotates the signing secret for a webhook endpoint in the authenticated project."""
return self._json(_ROTATE_WEBHOOK_ENDPOINT_SIGNING_SECRET, _c.encoded_path("/webhook_endpoints/{}/rotate_secret", webhook_endpoint_id), None, _c.json_body(payload), include_response)test_webhook_endpoint#
test_webhook_endpoint(webhook_endpoint_id: str, *, payload: _T.TestWebhookEndpointRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.TestWebhookEndpoint200, _Errors]
test_webhook_endpoint(webhook_endpoint_id: str, *, payload: _T.TestWebhookEndpointRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.TestWebhookEndpoint200, _HttpClientResponse], _Errors]Sends a sample event to a webhook endpoint for the authenticated project.
| Parameter | Type | Description |
|---|---|---|
webhook_endpoint_id | ||
payload | ||
include_response | = False |
@_t.overload
def test_webhook_endpoint(self, webhook_endpoint_id: str, *, payload: _T.TestWebhookEndpointRequestJson, include_response: _t.Literal[False] = False) -> _Effect[_T.TestWebhookEndpoint200, _Errors]: ...
@_t.overload
def test_webhook_endpoint(self, webhook_endpoint_id: str, *, payload: _T.TestWebhookEndpointRequestJson, include_response: _t.Literal[True]) -> _Effect[tuple[_T.TestWebhookEndpoint200, _HttpClientResponse], _Errors]: ...
def test_webhook_endpoint(self, webhook_endpoint_id: str, *, payload: _T.TestWebhookEndpointRequestJson, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Sends a sample event to a webhook endpoint for the authenticated project."""
return self._json(_TEST_WEBHOOK_ENDPOINT, _c.encoded_path("/webhook_endpoints/{}/test", webhook_endpoint_id), None, _c.json_body(payload), include_response)list_webhook_event_types#
list_webhook_event_types(*, include_response: _t.Literal[False] = False) -> _Effect[_T.ListWebhookEventTypes200, _Errors]
list_webhook_event_types(*, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListWebhookEventTypes200, _HttpClientResponse], _Errors]Returns webhook event types visible to the authenticated project.
| Parameter | Type | Description |
|---|---|---|
include_response | = False |
@_t.overload
def list_webhook_event_types(self, *, include_response: _t.Literal[False] = False) -> _Effect[_T.ListWebhookEventTypes200, _Errors]: ...
@_t.overload
def list_webhook_event_types(self, *, include_response: _t.Literal[True]) -> _Effect[tuple[_T.ListWebhookEventTypes200, _HttpClientResponse], _Errors]: ...
def list_webhook_event_types(self, *, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns webhook event types visible to the authenticated project."""
return self._json(_LIST_WEBHOOK_EVENT_TYPES, "/webhook_event_types", None, None, include_response)beta_create_response#
beta_create_response(*, payload: _T.BetaCreateResponseRequestJson, params: _T.BetaCreateResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaCreateResponse200, _Errors]
beta_create_response(*, payload: _T.BetaCreateResponseRequestJson, params: _T.BetaCreateResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaCreateResponse200, _HttpClientResponse], _Errors]Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
| Parameter | Type | Description |
|---|---|---|
payload | ||
params | = None | |
include_response | = False |
@_t.overload
def beta_create_response(self, *, payload: _T.BetaCreateResponseRequestJson, params: _T.BetaCreateResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaCreateResponse200, _Errors]: ...
@_t.overload
def beta_create_response(self, *, payload: _T.BetaCreateResponseRequestJson, params: _T.BetaCreateResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaCreateResponse200, _HttpClientResponse], _Errors]: ...
def beta_create_response(self, *, payload: _T.BetaCreateResponseRequestJson, params: _T.BetaCreateResponseParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Creates a model response. Provide [text](https://developers.openai.com/api/docs/guides/text) or
[image](https://developers.openai.com/api/docs/guides/images-vision) inputs to generate [text](https://developers.openai.com/api/docs/guides/text)
or [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have the model call
your own [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use built-in
[tools](https://developers.openai.com/api/docs/guides/tools) like [web search](https://developers.openai.com/api/docs/guides/tools-web-search)
or [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use your own data
as input for the model's response."""
return self._json(_BETA_CREATE_RESPONSE, "/responses?beta=true", params, _c.json_body(payload), include_response)beta_create_response_sse#
beta_create_response_sse(*, payload, params=None) -> _Stream[_sse.DataEvent[_T.BetaCreateResponse200Sse], _SseErrors]Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
| Parameter | Type | Description |
|---|---|---|
payload | _T.BetaCreateResponseRequestJson | |
params | _T.BetaCreateResponseParams | None = None |
Returns _Stream[_sse.DataEvent[_T.BetaCreateResponse200Sse], _SseErrors]
def beta_create_response_sse(self, *, payload: _T.BetaCreateResponseRequestJson, params: _T.BetaCreateResponseParams | None = None) -> _Stream[_sse.DataEvent[_T.BetaCreateResponse200Sse], _SseErrors]:
"""Creates a model response. Provide [text](https://developers.openai.com/api/docs/guides/text) or
[image](https://developers.openai.com/api/docs/guides/images-vision) inputs to generate [text](https://developers.openai.com/api/docs/guides/text)
or [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have the model call
your own [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use built-in
[tools](https://developers.openai.com/api/docs/guides/tools) like [web search](https://developers.openai.com/api/docs/guides/tools-web-search)
or [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use your own data
as input for the model's response."""
return self._sse(_BETA_CREATE_RESPONSE_SSE, "/responses?beta=true", params, _c.json_body(payload), BetaCreateResponse200Sse)beta_get_response#
beta_get_response(response_id: str, *, params: _T.BetaGetResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaGetResponse200, _Errors]
beta_get_response(response_id: str, *, params: _T.BetaGetResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaGetResponse200, _HttpClientResponse], _Errors]Retrieves a model response with the given ID.
| Parameter | Type | Description |
|---|---|---|
response_id | ||
params | = None | |
include_response | = False |
@_t.overload
def beta_get_response(self, response_id: str, *, params: _T.BetaGetResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaGetResponse200, _Errors]: ...
@_t.overload
def beta_get_response(self, response_id: str, *, params: _T.BetaGetResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaGetResponse200, _HttpClientResponse], _Errors]: ...
def beta_get_response(self, response_id: str, *, params: _T.BetaGetResponseParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Retrieves a model response with the given ID."""
return self._json(_BETA_GET_RESPONSE, _c.encoded_path("/responses/{}?beta=true", response_id), params, None, include_response)beta_delete_response#
beta_delete_response(response_id: str, *, params: _T.BetaDeleteResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaDeleteResponse200, _Errors]
beta_delete_response(response_id: str, *, params: _T.BetaDeleteResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaDeleteResponse200, _HttpClientResponse], _Errors]Deletes a model response with the given ID.
| Parameter | Type | Description |
|---|---|---|
response_id | ||
params | = None | |
include_response | = False |
@_t.overload
def beta_delete_response(self, response_id: str, *, params: _T.BetaDeleteResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaDeleteResponse200, _Errors]: ...
@_t.overload
def beta_delete_response(self, response_id: str, *, params: _T.BetaDeleteResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaDeleteResponse200, _HttpClientResponse], _Errors]: ...
def beta_delete_response(self, response_id: str, *, params: _T.BetaDeleteResponseParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Deletes a model response with the given ID."""
return self._json(_BETA_DELETE_RESPONSE, _c.encoded_path("/responses/{}?beta=true", response_id), params, None, include_response)beta_cancel_response#
beta_cancel_response(response_id: str, *, params: _T.BetaCancelResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaCancelResponse200, _Errors]
beta_cancel_response(response_id: str, *, params: _T.BetaCancelResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaCancelResponse200, _HttpClientResponse], _Errors]Cancels a model response with the given ID. Only responses created with
the background parameter set to true can be cancelled.
Learn more.
| Parameter | Type | Description |
|---|---|---|
response_id | ||
params | = None | |
include_response | = False |
@_t.overload
def beta_cancel_response(self, response_id: str, *, params: _T.BetaCancelResponseParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaCancelResponse200, _Errors]: ...
@_t.overload
def beta_cancel_response(self, response_id: str, *, params: _T.BetaCancelResponseParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaCancelResponse200, _HttpClientResponse], _Errors]: ...
def beta_cancel_response(self, response_id: str, *, params: _T.BetaCancelResponseParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Cancels a model response with the given ID. Only responses created with
the `background` parameter set to `true` can be cancelled.
[Learn more](https://developers.openai.com/api/docs/guides/background)."""
return self._json(_BETA_CANCEL_RESPONSE, _c.encoded_path("/responses/{}/cancel?beta=true", response_id), params, None, include_response)beta_compactconversation#
beta_compactconversation(*, payload: _T.BetaCompactconversationRequestJson, params: _T.BetaCompactconversationParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaCompactconversation200, _Errors]
beta_compactconversation(*, payload: _T.BetaCompactconversationRequestJson, params: _T.BetaCompactconversationParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaCompactconversation200, _HttpClientResponse], _Errors]Compact a conversation. Returns a compacted response object.
Learn when and how to compact long-running conversations in the conversation state guide. For ZDR-compatible compaction details, see Compaction (advanced).
| Parameter | Type | Description |
|---|---|---|
payload | ||
params | = None | |
include_response | = False |
@_t.overload
def beta_compactconversation(self, *, payload: _T.BetaCompactconversationRequestJson, params: _T.BetaCompactconversationParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaCompactconversation200, _Errors]: ...
@_t.overload
def beta_compactconversation(self, *, payload: _T.BetaCompactconversationRequestJson, params: _T.BetaCompactconversationParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaCompactconversation200, _HttpClientResponse], _Errors]: ...
def beta_compactconversation(self, *, payload: _T.BetaCompactconversationRequestJson, params: _T.BetaCompactconversationParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Compact a conversation. Returns a compacted response object.
Learn when and how to compact long-running conversations in the [conversation state guide](https://developers.openai.com/api/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](https://developers.openai.com/api/docs/guides/conversation-state#compaction-advanced)."""
return self._json(_BETA_COMPACTCONVERSATION, "/responses/compact?beta=true", params, _c.json_body(payload), include_response)beta_list_input_items#
beta_list_input_items(response_id: str, *, params: _T.BetaListInputItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaListInputItems200, _Errors]
beta_list_input_items(response_id: str, *, params: _T.BetaListInputItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaListInputItems200, _HttpClientResponse], _Errors]Returns a list of input items for a given response.
| Parameter | Type | Description |
|---|---|---|
response_id | ||
params | = None | |
include_response | = False |
@_t.overload
def beta_list_input_items(self, response_id: str, *, params: _T.BetaListInputItemsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaListInputItems200, _Errors]: ...
@_t.overload
def beta_list_input_items(self, response_id: str, *, params: _T.BetaListInputItemsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaListInputItems200, _HttpClientResponse], _Errors]: ...
def beta_list_input_items(self, response_id: str, *, params: _T.BetaListInputItemsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns a list of input items for a given response."""
return self._json(_BETA_LIST_INPUT_ITEMS, _c.encoded_path("/responses/{}/input_items?beta=true", response_id), params, None, include_response)beta_getinputtokencounts#
beta_getinputtokencounts(*, payload: _T.BetaGetinputtokencountsRequestJson, params: _T.BetaGetinputtokencountsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaGetinputtokencounts200, _Errors]
beta_getinputtokencounts(*, payload: _T.BetaGetinputtokencountsRequestJson, params: _T.BetaGetinputtokencountsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaGetinputtokencounts200, _HttpClientResponse], _Errors]Returns input token counts of the request.
Returns an object with object set to response.input_tokens and an input_tokens count.
| Parameter | Type | Description |
|---|---|---|
payload | ||
params | = None | |
include_response | = False |
@_t.overload
def beta_getinputtokencounts(self, *, payload: _T.BetaGetinputtokencountsRequestJson, params: _T.BetaGetinputtokencountsParams | None = None, include_response: _t.Literal[False] = False) -> _Effect[_T.BetaGetinputtokencounts200, _Errors]: ...
@_t.overload
def beta_getinputtokencounts(self, *, payload: _T.BetaGetinputtokencountsRequestJson, params: _T.BetaGetinputtokencountsParams | None = None, include_response: _t.Literal[True]) -> _Effect[tuple[_T.BetaGetinputtokencounts200, _HttpClientResponse], _Errors]: ...
def beta_getinputtokencounts(self, *, payload: _T.BetaGetinputtokencountsRequestJson, params: _T.BetaGetinputtokencountsParams | None = None, include_response: bool = False) -> _Effect[_t.Any, _Errors]:
"""Returns input token counts of the request.
Returns an object with `object` set to `response.input_tokens` and an `input_tokens` count."""
return self._json(_BETA_GETINPUTTOKENCOUNTS, "/responses/input_tokens?beta=true", params, _c.json_body(payload), include_response)On This Page
AttributesFunctions__init__list_assistantscreate_assistantget_assistantmodify_assistantdelete_assistantcreate_speechcreate_speech_ssecreate_speech_streamcreate_transcriptioncreate_transcription_ssecreate_translationlist_voice_consentscreate_voice_consentget_voice_consentupdate_voice_consentdelete_voice_consentcreate_voicelist_batchescreate_batchretrieve_batchcancel_batchlist_chat_completionscreate_chat_completioncreate_chat_completion_sseget_chat_completionupdate_chat_completiondelete_chat_completionget_chat_completion_messagescreate_completionlist_containerscreate_containerretrieve_containerdelete_containerlist_container_filescreate_container_fileretrieve_container_filedelete_container_fileretrieve_container_file_contentretrieve_container_file_content_streamlist_conversation_itemscreate_conversation_itemsget_conversation_itemdelete_conversation_itemcreate_embeddinglist_evalscreate_evalget_evalupdate_evaldelete_evalget_eval_runscreate_eval_runget_eval_rundelete_eval_runcancel_eval_runget_eval_run_output_itemsget_eval_run_output_itemlist_filescreate_fileretrieve_filedelete_filedownload_filedownload_file_streamrun_gradervalidate_graderlist_fine_tuning_checkpoint_permissionscreate_fine_tuning_checkpoint_permissiondelete_fine_tuning_checkpoint_permissionlist_paginated_fine_tuning_jobscreate_fine_tuning_jobretrieve_fine_tuning_jobcancel_fine_tuning_joblist_fine_tuning_job_checkpointslist_fine_tuning_eventspause_fine_tuning_jobresume_fine_tuning_jobcreate_image_editcreate_image_edit_ssecreate_imagecreate_image_ssecreate_image_variationcreate_liveaccept_live_sessionfork_live_sessionhangup_live_sessionrefer_live_sessionreject_live_sessionlist_modelsretrieve_modeldelete_modelcreate_moderationadmin_api_keys_listadmin_api_keys_createadmin_api_keys_getadmin_api_keys_deletelist_audit_logslist_organization_certificatesupload_certificateactivate_organization_certificatesdeactivate_organization_certificatesget_certificatemodify_certificatedelete_certificateusage_costsretrieve_organization_data_retentionupdate_organization_data_retentionlist_groupscreate_groupretrieve_groupupdate_groupdelete_grouplist_group_role_assignmentsassign_group_roleretrieve_group_roleunassign_group_rolelist_group_usersadd_group_userretrieve_group_userremove_group_userlist_invitesinvite_userretrieve_invitedelete_invitelist_projectscreate_projectretrieve_projectmodify_projectlist_project_api_keysretrieve_project_api_keydelete_project_api_keyarchive_projectlist_project_certificatesactivate_project_certificatesdeactivate_project_certificatesretrieve_project_data_retentionupdate_project_data_retentionlist_project_groupsadd_project_groupretrieve_project_groupremove_project_groupretrieve_project_hosted_tool_permissionsupdate_project_hosted_tool_permissionsretrieve_project_model_permissionsupdate_project_model_permissionsdelete_project_model_permissionslist_project_rate_limitsupdate_project_rate_limitslist_project_service_accountscreate_project_service_accountretrieve_project_service_accountupdate_project_service_accountdelete_project_service_accountlist_project_spend_alertscreate_project_spend_alertretrieve_project_spend_alertupdate_project_spend_alertdelete_project_spend_alertlist_project_userscreate_project_userretrieve_project_usermodify_project_userdelete_project_userlist_rolescreate_roleretrieve_roleupdate_roledelete_rolelist_organization_spend_alertscreate_organization_spend_alertretrieve_organization_spend_alertupdate_organization_spend_alertdelete_organization_spend_alertusage_audio_speechesusage_audio_transcriptionsusage_code_interpreter_sessionsusage_completionsusage_embeddingsusage_file_search_callsusage_imagesusage_moderationsusage_vector_storesusage_web_search_callslist_usersretrieve_usermodify_userdelete_userlist_user_role_assignmentsassign_user_roleretrieve_user_roleunassign_user_rolelist_project_group_role_assignmentsassign_project_group_roleretrieve_project_group_roleunassign_project_group_rolelist_project_rolescreate_project_roleretrieve_project_roleupdate_project_roledelete_project_rolelist_project_user_role_assignmentsassign_project_user_roleretrieve_project_user_roleunassign_project_user_rolecreate_realtime_callaccept_realtime_callhangup_realtime_callrefer_realtime_callreject_realtime_callcreate_realtime_client_secretcreate_realtime_sessioncreate_realtime_transcription_sessioncreate_realtime_translation_client_secretcreate_responsecreate_response_sseget_responsedelete_responsecancel_responselist_input_itemscreate_threadcreate_thread_and_runcreate_thread_and_run_sseget_threadmodify_threaddelete_threadlist_messagescreate_messageget_messagemodify_messagedelete_messagelist_runscreate_runcreate_run_sseget_runmodify_runcancel_runlist_run_stepsget_run_stepsubmit_tool_ouputs_to_runsubmit_tool_ouputs_to_run_ssecreate_uploadcancel_uploadcomplete_uploadadd_upload_partlist_vector_storescreate_vector_storeget_vector_storemodify_vector_storedelete_vector_storecreate_vector_store_file_batchget_vector_store_file_batchcancel_vector_store_file_batchlist_files_in_vector_store_batchlist_vector_store_filescreate_vector_store_fileget_vector_store_fileupdate_vector_store_file_attributesdelete_vector_store_fileretrieve_vector_store_file_contentsearch_vector_storecreate_conversationget_conversationupdate_conversationdelete_conversationgetsafetycasegetprojectsafetyalertdownload_live_recordingdownload_live_recording_streamorganization_decisionsusagelistexternalstorageconfigurationscreateanexternalstorageconfigurationgetanexternalstorageconfigurationdeleteanexternalstorageconfigurationvalidateanexternalstorageconfigurationgetorganizationspendlimitupdateorganizationspendlimitdeleteorganizationspendlimitgetprojectspendlimitupdateprojectspendlimitdeleteprojectspendlimitcreatean_ap_ikeyforaserviceaccountcreatecontentprovenancechecklist_videoscreate_videocreate_video_characterget_video_charactercreate_video_editcreate_video_extendget_videodelete_videoretrieve_video_contentretrieve_video_content_streamcreate_video_remixgetinputtokencountscompactconversationlist_skillscreate_skillget_skillupdate_skill_default_versiondelete_skillget_skill_contentget_skill_content_streamlist_skill_versionscreate_skill_versionget_skill_versiondelete_skill_versionget_skill_version_contentget_skill_version_content_streamcancel_chat_session_methodcreate_chat_session_methodlist_thread_items_methodget_thread_methoddelete_thread_methodlist_threads_methodcreate_decisionlist_agent_environmentscreate_agent_environmentretrieve_agent_environmentlist_agent_environment_filescreate_agent_environment_filelist_agent_session_subagentsretrieve_agent_session_subagentlist_agent_session_subagent_itemslist_agent_session_subagent_turnsretrieve_agent_session_subagent_turnlist_agent_session_subagent_turn_itemslist_agentscreate_agentretrieve_agentupdate_agentdelete_agentlist_agent_environment_templatescreate_agent_environment_templateretrieve_agent_environment_templateupdate_agent_environment_templatedelete_agent_environment_templatelist_agent_sessionscreate_agent_sessioncreate_agent_session_sseretrieve_agent_sessionupdate_agent_sessiondelete_agent_sessionlist_agent_session_artifactsretrieve_agent_session_artifactdelete_agent_session_artifactretrieve_agent_session_artifact_contentretrieve_agent_session_artifact_content_streamlist_agent_session_eventslist_agent_session_events_ssecreate_agent_session_eventslist_agent_session_itemslist_agent_session_traceslist_agent_session_turnsretrieve_agent_session_turnlist_agent_session_turn_itemslist_vaultscreate_vaultretrieve_vaultupdate_vaultdelete_vaultlist_vault_credentialscreate_vault_credentialretrieve_vault_credentialrotate_vault_credentialdelete_vault_credentiallist_webhook_endpointscreate_webhook_endpointretrieve_webhook_endpointupdate_webhook_endpointdelete_webhook_endpointrotate_webhook_endpoint_signing_secrettest_webhook_endpointlist_webhook_event_typesbeta_create_responsebeta_create_response_ssebeta_get_responsebeta_delete_responsebeta_cancel_responsebeta_compactconversationbeta_list_input_itemsbeta_getinputtokencounts