Returns the agent with the provided ID.
agentId required | string |
squid .ai() .agent('resume-agent') .get() .then(agent => { console.log(agent); });
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "description": "string",
- "isPublic": true,
- "auditLog": true,
- "embeddingModelName": "text-embedding-3-small",
- "options": {
- "maxTokens": 0.1,
- "chatId": "string",
- "disableHistory": true,
- "memoryOptions": {
- "memoryMode": "none",
- "memoryId": "string"
}, - "disableContext": true,
- "enablePromptRewriteForRag": true,
- "includeReference": true,
- "responseFormat": "text",
- "smoothTyping": true,
- "agentContext": { },
- "functions": [
- "string"
], - "instructions": "string",
- "contextMetadataFilter": {
- "property1": {
- "$eq": 0.1
}, - "property2": {
- "$eq": 0.1
}
}, - "voiceOptions": {
- "modelName": "tts-1",
- "voice": "alloy",
- "responseFormat": "mp3",
- "instructions": "string",
- "speed": 0.1
}, - "connectedAgents": [
- {
- "agentId": "string",
- "description": "string"
}
], - "connectedIntegrations": [
- {
- "integrationId": "string",
- "integrationType": "active_directory",
- "description": "string",
- "instructions": "string",
- "options": null
}
], - "quotas": {
- "maxAiCallStackSize": 0.1
}, - "includeMetadata": true,
- "temperature": 0.1,
- "guardrails": {
- "custom": "string",
- "disablePii": true,
- "professionalTone": true,
- "offTopicAnswers": true,
- "disableProfanity": true
}, - "model": "gemini-2.5-pro",
- "rerankProvider": "cohere",
- "integrationMetadata": {
- "integrationId": "string",
- "integrationType": "active_directory",
- "description": "string",
- "instructions": "string",
- "options": null
}, - "executionPlanOptions": {
- "enabled": true,
- "model": "gemini-2.5-pro",
- "reasoningEffort": "low"
}, - "groundingWithWebSearch": true
}
}
Creates or updates the AI agent with the provided parameters.
id required | string (AiAgentId) ID of AI agent. Also known as AI profile id. |
description | string An optional description of the agent's purpose or capabilities. |
isPublic | boolean Indicates whether the agent is publicly accessible; defaults to false. |
auditLog | boolean Enables audit logging for the agent's activities if true; defaults to false. |
embeddingModelName | string (AiEmbeddingsModelName) Enum: "text-embedding-3-small" "voyage-3-large" |
GeminiChatOptions (object) or OpenAiReasoningChatOptions (object) or OpenAiChatOptions (object) or AnthropicChatOptions (object) (ApiAiAgentChatOptions) |
{- "id": "string",
- "description": "string",
- "isPublic": true,
- "auditLog": true,
- "embeddingModelName": "text-embedding-3-small",
- "options": {
- "maxTokens": 0.1,
- "chatId": "string",
- "disableHistory": true,
- "memoryOptions": {
- "memoryMode": "none",
- "memoryId": "string"
}, - "disableContext": true,
- "enablePromptRewriteForRag": true,
- "includeReference": true,
- "responseFormat": "text",
- "smoothTyping": true,
- "agentContext": { },
- "functions": [
- "string"
], - "instructions": "string",
- "contextMetadataFilter": {
- "property1": {
- "$eq": 0.1
}, - "property2": {
- "$eq": 0.1
}
}, - "voiceOptions": {
- "modelName": "tts-1",
- "voice": "alloy",
- "responseFormat": "mp3",
- "instructions": "string",
- "speed": 0.1
}, - "connectedAgents": [
- {
- "agentId": "string",
- "description": "string"
}
], - "connectedIntegrations": [
- {
- "integrationId": "string",
- "integrationType": "active_directory",
- "description": "string",
- "instructions": "string",
- "options": null
}
], - "quotas": {
- "maxAiCallStackSize": 0.1
}, - "includeMetadata": true,
- "temperature": 0.1,
- "guardrails": {
- "custom": "string",
- "disablePii": true,
- "professionalTone": true,
- "offTopicAnswers": true,
- "disableProfanity": true
}, - "model": "gemini-2.5-pro",
- "rerankProvider": "cohere",
- "integrationMetadata": {
- "integrationId": "string",
- "integrationType": "active_directory",
- "description": "string",
- "instructions": "string",
- "options": null
}, - "executionPlanOptions": {
- "enabled": true,
- "model": "gemini-2.5-pro",
- "reasoningEffort": "low"
}, - "groundingWithWebSearch": true
}
}
Adds or updates multiple agent contexts (knowledge). If some of the contexts are of type 'file', a corresponding file should be uploaded.
agentId required | string The ID of the agent to add the contexts to. |
contexts required | string A JSON string representing an array of AgentContextRequest objects. |
files | Array of strings <binary> [ items <binary > ] The context files to upload. |
void squid .ai() .agent('resume-agent') .upsertContexts( [ { contextId: 'ctx1', type: 'text', text: 'Some knowledge', title: 'Text knowledge', }, { contextId: 'ctx2', type: 'file' }, ], [new File(['file content'], 'file.txt')], );
Deletes multiple agent contexts (knowledge) from the agent by their IDs.
agentId required | string (AiAgentId) ID of AI agent. Also known as AI profile id. |
contextIds required | Array of strings |
{- "agentId": "string",
- "contextIds": [
- "string"
]
}
Returns a context (knowledge) of the agent by its ID.
agentId required | string |
contextId required | string |
squid .ai() .agent('resume-agent') .getContext('ctx1') .then(context => { console.log(context); });
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "agentId": "string",
- "type": "text",
- "title": "string",
- "text": "string",
- "preview": true,
- "sizeBytes": 0.1,
- "metadata": { }
}
Changes the AI model used by the agent.
agentId required | string |
required | VendorAiChatModelName (string) or UserAiChatModelName (string) (AiChatModelName) |
{- "agentId": "string",
- "model": "gemini-2.5-pro"
}
Updates the list of agents connected to this agent.
agentId required | string |
required | Array of objects (AiConnectedAgentMetadata) |
{- "agentId": "string",
- "connectedAgents": [
- {
- "agentId": "string",
- "description": "string"
}
]
}
Lists all contexts associated with the agent.
agentId required | string |
squid .ai() .agent('resume-agent') .listContexts() .then(contexts => { console.log(contexts); });
{- "contexts": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "agentId": "string",
- "type": "text",
- "title": "string",
- "text": "string",
- "preview": true,
- "sizeBytes": 0.1,
- "metadata": { }
}
]
}
Updates the agent's guardrails settings.
agentId required | string |
required | object (GuardrailsOptions) Options for applying guardrails to AI responses to enforce specific constraints. |
{- "agentId": "string",
- "guardrails": {
- "custom": "string",
- "disablePii": true,
- "professionalTone": true,
- "offTopicAnswers": true,
- "disableProfanity": true
}
}
Update custom guardrails for the agent.
agentId required | string |
customGuardrail required | string |
{- "agentId": "string",
- "customGuardrail": "string"
}
Sends a prompt and returns a full text answer.
agentId required | string |
prompt required | string |
GeminiChatOptions (object) or OpenAiReasoningChatOptions (object) or OpenAiChatOptions (object) or AnthropicChatOptions (object) (ApiAiAgentChatOptions) |
{- "agentId": "string",
- "prompt": "string",
- "options": {
- "maxTokens": 0.1,
- "chatId": "string",
- "disableHistory": true,
- "memoryOptions": {
- "memoryMode": "none",
- "memoryId": "string"
}, - "disableContext": true,
- "enablePromptRewriteForRag": true,
- "includeReference": true,
- "responseFormat": "text",
- "smoothTyping": true,
- "agentContext": { },
- "functions": [
- "string"
], - "instructions": "string",
- "contextMetadataFilter": {
- "property1": {
- "$eq": 0.1
}, - "property2": {
- "$eq": 0.1
}
}, - "voiceOptions": {
- "modelName": "tts-1",
- "voice": "alloy",
- "responseFormat": "mp3",
- "instructions": "string",
- "speed": 0.1
}, - "connectedAgents": [
- {
- "agentId": "string",
- "description": "string"
}
], - "connectedIntegrations": [
- {
- "integrationId": "string",
- "integrationType": "active_directory",
- "description": "string",
- "instructions": "string",
- "options": null
}
], - "quotas": {
- "maxAiCallStackSize": 0.1
}, - "includeMetadata": true,
- "temperature": 0.1,
- "guardrails": {
- "custom": "string",
- "disablePii": true,
- "professionalTone": true,
- "offTopicAnswers": true,
- "disableProfanity": true
}, - "model": "gemini-2.5-pro",
- "rerankProvider": "cohere",
- "integrationMetadata": {
- "integrationId": "string",
- "integrationType": "active_directory",
- "description": "string",
- "instructions": "string",
- "options": null
}, - "executionPlanOptions": {
- "enabled": true,
- "model": "gemini-2.5-pro",
- "reasoningEffort": "low"
}, - "groundingWithWebSearch": true
}
}
{- "responseString": "string"
}
Performs a semantic search using the agent's knowledge base.
agentId required | string |
required | object (AiSearchOptions) The options for the AI agent search method. |
{- "agentId": "string",
- "options": {
- "prompt": "string",
- "contextMetadataFilter": {
- "property1": {
- "$eq": 0.1
}, - "property2": {
- "$eq": 0.1
}
}, - "limit": 0.1,
- "rerankProvider": "cohere"
}
}
{- "chunks": [
- {
- "data": "string",
- "metadata": { },
- "score": 0.1
}
]
}
Transcribes the spoken content of an uploaded audio file into text.
file required | string <binary> The audio file to transcribe. |
optionsJson required | string A JSON string representing a AiAudioTranscribeOptions object. |
void squid.ai().audio().createSpeech('Create a speech of a men talking with his son', { modelName: 'tts-1', });
"string"
Converts text into synthesized speech and returns an audio file URL. The URL will be available for one hour.
The request object containing the input text and options for speech synthesis.
input required | string |
required | object (AiAudioCreateSpeechOptions) Options for creating speech using OpenAI's text-to-speech models. |
{- "input": "string",
- "options": {
- "modelName": "tts-1",
- "voice": "alloy",
- "responseFormat": "mp3",
- "instructions": "string",
- "speed": 0.1
}
}
Generates an image using AI and returns a url to the generated image. The url will be available for one hour.
The request object containing the prompt and options for image generation.
prompt required | string |
required | DallEOptions (object) or StableDiffusionCoreOptions (object) or FluxOptions (object) (AiGenerateImageOptions) |
{- "prompt": "string",
- "options": {
- "modelName": "dall-e-3",
- "quality": "hd",
- "size": "1024x1024",
- "numberOfImagesToGenerate": 1
}
}
"string"
Generates an image using AI and returns a url to the generated image. The url will be available for one hour.
file required | string <binary> The image file to be processed. |
void squid .ai() .image() .removeBackground(new File(['<Actual file content>'], 'file.png'));
"string"
Retrieves matchmaker details.
matchMakerId required | string The ID of the matchmaker to retrieve. --squidCodeSampleFile ./src/code-samples/matchmaking/matchmaker-getMatchMaker.ts,Client SDK |
{- "matchMaker": {
- "id": "string",
- "description": "string",
- "categories": [
- {
- "id": "string",
- "description": "string"
}
]
}
}
Creates a new matchmaker.
The matchmaker object to create.
--squidCodeSampleFile ./src/code-samples/matchmaking/matchmaker-create.ts,Client SDK
id required | string The unique identifier of the matchmaker. |
description required | string A description aiding the AI in understanding the matchmaker's domain. |
required | Array of objects (MmCategory) An array of categories defining the types of entities that can be matched. |
{- "id": "string",
- "description": "string",
- "categories": [
- {
- "id": "string",
- "description": "string"
}
]
}
{- "id": "string",
- "description": "string",
- "categories": [
- {
- "id": "string",
- "description": "string"
}
]
}
squid .ai() .matchMaking() .listMatchMakers() .then(matchmakers => { console.log(matchmakers); });
{- "matchMakers": [
- {
- "id": "string",
- "description": "string",
- "categories": [
- {
- "id": "string",
- "description": "string"
}
]
}
]
}
Deletes an existing matchmaker by its ID.
The request object containing the matchmaker ID to delete.
--squidCodeSampleFile ./src/code-samples/matchmaking/matchmaker-delete.ts,Client SDK
matchMakerId required | string |
{- "matchMakerId": "string"
}
Inserts a new entity into the specified matchmaker.
The request object containing the matchmaker ID and entities to insert.
--squidCodeSampleFile ./src/code-samples/matchmaking/matchmaker-insertManyEntities.ts,Client SDK
matchMakerId required | string |
required | Array of objects (MmEntity) |
{- "matchMakerId": "string",
- "entities": [
- {
- "id": "string",
- "content": "string",
- "categoryId": "string",
- "metadata": { }
}
]
}
Deletes a specific entity from the matchmaker.
The request object containing the matchmaker ID and entity ID to delete.
matchMakerId required | string |
entityId required | string |
{- "matchMakerId": "string",
- "entityId": "string"
}
Finds matches for an entity already inserted in the matchmaker.
The request object containing the matchmaker ID, entity ID, and options for finding matches.
matchMakerId required | string |
entityId required | string |
required | object (MmFindMatchesOptions) Represents options for finding matches in the matchmaker system. |
{- "matchMakerId": "string",
- "entityId": "string",
- "options": {
- "metadataFilter": {
- "property1": {
- "$eq": 0.1
}, - "property2": {
- "$eq": 0.1
}
}, - "limit": 0.1,
- "matchToCategoryId": "string"
}
}
{- "matches": [
- {
- "id": "string",
- "content": "string",
- "categoryId": "string",
- "metadata": { },
- "score": 0.1,
- "reasoning": "string"
}
]
}
Finds matches for an entity not yet inserted into the matchmaker.
The request object containing the matchmaker ID, entity, and options for finding matches.
matchMakerId required | string |
required | object (Omit_MmEntity.metadata-or-id_) From T, pick a set of properties whose keys are in the union K |
required | object (MmFindMatchesOptions) Represents options for finding matches in the matchmaker system. |
{- "matchMakerId": "string",
- "entity": {
- "content": "string",
- "categoryId": "string"
}, - "options": {
- "metadataFilter": {
- "property1": {
- "$eq": 0.1
}, - "property2": {
- "$eq": 0.1
}
}, - "limit": 0.1,
- "matchToCategoryId": "string"
}
}
{- "matches": [
- {
- "id": "string",
- "content": "string",
- "categoryId": "string",
- "metadata": { },
- "score": 0.1,
- "reasoning": "string"
}
]
}
Lists entities in the specified category within the matchmaker.
The request object containing the matchmaker ID, category ID, and options for listing entities.
matchMakerId required | string |
categoryId required | string |
required | object (MmListEntitiesOptions) Represents options for listing entities in the matchmaker system.
|
{- "matchMakerId": "string",
- "categoryId": "string",
- "options": {
- "metadataFilter": {
- "property1": {
- "$eq": 0.1
}, - "property2": {
- "$eq": 0.1
}
}, - "limit": 0.1
}
}
{- "entities": [
- {
- "id": "string",
- "content": "string",
- "categoryId": "string",
- "metadata": { }
}
]
}
Retrieves a specific entity from the matchmaker.
matchMakerId required | string The ID of the matchmaker. |
entityId required | string The ID of the entity to retrieve. |
squid .ai() .matchMaking() .getMatchMaker('resume-and-job-description') .then(matchmaker => { if (!matchmaker) return; return matchmaker.getEntity('resumeId1'); });
{- "entity": {
- "id": "string",
- "content": "string",
- "categoryId": "string",
- "metadata": { }
}
}
Search the web using AI. Returns a response containing Markdown text and cited URLs.
The request object containing the search query.
query required | string The search query. |
{- "query": "string"
}
{- "markdownText": "string",
- "citedUrls": [
- {
- "url": "string",
- "title": "string"
}
]
}
Fetch content from a URL. Returns the content in Markdown format.
The request object containing the URL to fetch content from.
url required | string The URL to fetch content from. |
{- "url": "string"
}
{- "markdownText": "string"
}
Create a shortened URL for the given URL.
url required | string The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or https://). |
secondsToLive | number <double> Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 1 day. |
{- "url": "string",
- "secondsToLive": 0.1
}
{- "id": "string",
- "shortUrl": "string",
- "expiry": "2019-08-24T14:15:22Z"
}
Create shortened URLs for the given URLs.
urls required | Array of strings The URLs to shorten. They must be valid URLs and should include the protocol (start with http:// or https://). |
secondsToLive | number <double> Seconds to live for all shortened URLs. If set to 0, the URLs will never expire. Defaults to 1 day. |
{- "urls": [
- "string"
], - "secondsToLive": 0.1
}
{- "ids": [
- "string"
], - "shortUrls": [
- "string"
], - "expiry": "2019-08-24T14:15:22Z"
}
Executes an AI query using a specific DB integration, sending a prompt to the AI and returning its response.This function allows for direct interaction with the AI's capabilities by sending text prompts and receiving the AI's responses, which can be used for various applications such as automating tasks, generating content,or obtaining information.
The request object containing the integration ID, prompt, and options for the AI query.
integrationId required | string (IntegrationId) A type alias for an integration id. |
prompt required | string User-provided prompt for the AI query. |
object (ExecuteAiQueryOptions) Options for configuring AI query execution. Includes instructions, model overrides, and additional execution settings. |
{- "integrationId": "string",
- "prompt": "string",
- "options": {
- "instructions": "string",
- "collectionsToUse": [
- "string"
], - "enableRawResults": true,
- "enableCodeInterpreter": true,
- "overrideModel": "gemini-2.5-pro",
- "generateWalkthrough": true,
- "maxErrorCorrections": 0.1
}
}
{- "answer": "string",
- "explanation": "string",
- "executedQuery": "string",
- "queryMarkdownType": "string",
- "rawResultsUrl": "string",
- "success": true
}
Creates a pdf from HTML or url.
The create PDF request containing the HTML or URL to convert to PDF with additional options.
type required | string Value: "url" The type of PDF creation, always 'url' for this request. |
CreatePdfOutputFormatOptions (object) or CreatePdfOutputDimensionsOptions (object) (CreatePdfOutputOptions) Combined formatting options for creating a PDF document. | |
title | string Optional title for the PDF document. |
url required | string The URL of the webpage to convert into a PDF. |
{- "type": "url",
- "outputOptions": {
- "type": "format",
- "format": "letter"
}, - "title": "string",
- "url": "string"
}
{- "url": "string"
}
Extracts text and images (if requested) from a url.
The request containing the document file and options for extraction.
url required | string The publicly accessible URL pointing to the document file. |
object (ExtractDataFromDocumentOptions) Options for customizing how data is extracted from a document. |
{- "url": "string",
- "options": {
- "imageMinSizePixels": 0.1,
- "extractImages": true,
- "pageIndexes": [
- 0.1
], - "preferredExtractionMethod": "mistral_ocr"
}
}
{- "pages": [
- {
- "title": "string",
- "index": 0.1,
- "content": "string",
- "images": [
- {
- "id": "string",
- "textToReplaceInContent": "string",
- "imageBase64Url": "string"
}
]
}
]
}
Extracts text and images (if requested) from a document file.
request required | string The request containing the document file and options for extraction in JSON format. |
file required | Array of strings <binary> [ items <binary > ] The document file to extract data from, uploaded as a file. |
squid .extraction() .extractDataFromDocumentFile(new File(['file content'], 'file.txt'), { extractImages: false, }) .then(response => { console.log(response.pages); });
{- "pages": [
- {
- "title": "string",
- "index": 0.1,
- "content": "string",
- "images": [
- {
- "id": "string",
- "textToReplaceInContent": "string",
- "imageBase64Url": "string"
}
]
}
]
}