"OpenAI" (Service Connection)
Connecting & Authenticating
Requests
"TestConnection" — returns Success for working connection, Failure otherwise
"Completion" — create text completion for a given prompt
"Chat" — create a response for the given chat conversation
"Embedding" — create an embedding vector representing the input text
"ImageCreate" — create a square image given a prompt
"ImageVariation" — create a variation of a given image
"ImageEdit" — create an edited image given an original image and a prompt
"AudioTranscription" — transcribe an audio recording into the input language
"AudioTranslation" — translate an audio recording into English
"SpeechSynthesize" — synthesize speech from text
"ChatModelList" — list models available for the "Chat" request
"CompletionModelList" — list models available for the "Completion" request
"EmbeddingModelList" — list models available for the "Embedding" request
"ModerationModelList" — list models available for the "Moderation" request
"ImageModelList" — list models available for the image-related requests
"SpeechSynthesizeModelList" — list models available for the "SpeechSynthesize" request
"AudioModelList" — list models available for the "AudioTranscribe" request
"Moderation" — classify if text violates OpenAI's Content Policy
Examples
open all close allBasic Examples (1)
Scope (10)
Text (4)
Completion (1)
Change the sampling temperature:
Increase the number of characters returned:
Return multiple completions:
Include the prompt in the returned completion:
Chat (2)
Respond to a chat containing multiple messages:
Change the sampling temperature:
Increase the number of characters returned:
Return multiple completions:
Allow the model to use an LLMTool :
Send multimodal input:
Send a chat request asynchronously using ServiceSubmit and collect the response using the HandlerFunctions and HandlerFunctionsKeys options:
Embedding (1)
Compute the embedding for multiple sentences:
Plot the results:
Compute the embeddings for a list of words:
Plot the results:
Image (3)
ImageCreate (1)
ImageVariation (1)
Audio (3)
AudioTranscription (1)
Transcribe an Audio object:
Use a prompt to provide context for the transcription:
Transcribe a recording made in a different language:
Increase the temperature used for the sampling:
Include timestamps in the transcription:
AudioTranslation (1)
Translate an Audio object into English:
Use a prompt to provide context for the translation:
Increase the temperature used for the sampling:
SpeechSynthesize (1)
Synthesize a piece of text:
Use a different voice for the synthesis:
Authentication (4)
If no connections exist, ServiceConnect will prompt a dialog where an API key can be entered:
The API key can also be specified using the Authentication option:
Use credentials stored in SystemCredential :
The credentials are stored directly by the framework, since SystemCredential ["key"] evaluates to a string:
Only store the SystemCredential key rather than its value by using RuleDelayed :
Retrieve the value of the authentication credentials used in a specific service object:
Overwrite the authentication credentials of an existing service object:
See Also
ServiceExecute ▪ ServiceConnect ▪ LLMFunction ▪ LLMSynthesize ▪ ChatEvaluate ▪ LLMConfiguration ▪ ImageSynthesize ▪ SpeechRecognize
Service Connections: AlephAlpha ▪ Anthropic ▪ Cohere ▪ DeepSeek ▪ GoogleGemini ▪ Groq ▪ MistralAI ▪ TogetherAI ▪ GoogleSpeech