Search by

softcreatr / php-mistral-ai-sdk

SoftCreatR

A PSR-17/PSR-18 compatible PHP SDK for the Mistral AI API.

4.0.0 2026-09-12 16:46 UTC

This package is auto-updated.

Last update: 2026-09-12 16:49:40 UTC


README

Tests Latest Release PHP License

A lightweight, underrated PSR-17/PSR-18 client for the current Mistral AI API, with examples for every exposed SDK method, SSE streaming, streamed multipart uploads, and structured errors.

Requirements

  • PHP 8.1 or newer. CI tests PHP 8.1, 8.2, 8.3, 8.4, and 8.5.
  • A PSR-17 request, stream, and URI factory.
  • A PSR-18 HTTP client.
  • The JSON extension.

Guzzle is used below because it provides both the PSR-17 factories and a PSR-18 client implementation. The SDK itself depends only on the PSR interfaces, so other compliant implementations remain supported.

Installation

composer require softcreatr/php-mistral-ai-sdk guzzlehttp/guzzle

Client Setup

<?php

declare(strict_types=1);

require __DIR__ . '/vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Psr7\HttpFactory;
use SoftCreatR\MistralAI\MistralAI;

$factory = new HttpFactory();
$mistral = new MistralAI(
    requestFactory: $factory,
    streamFactory: $factory,
    uriFactory: $factory,
    httpClient: new Client(['stream' => true]),
    apiKey: (string) getenv('MISTRAL_API_KEY'),
);

Keep API keys on the server and out of source control.

Chat Completions

use const JSON_THROW_ON_ERROR;

$response = $mistral->createChatCompletion([
    'model' => 'mistral-small-latest',
    'messages' => [
        ['role' => 'user', 'content' => 'Give me a one-sentence summary of PSR-18.'],
    ],
]);

$result = json_decode((string) $response->getBody(), true, 512, JSON_THROW_ON_ERROR);
echo $result['choices'][0]['message']['content'];

Endpoint methods return a PSR-7 ResponseInterface, including calls that deliver SSE events to a callback.

Arguments

Body-only endpoints use a single body array:

$mistral->createEmbedding([
    'model' => 'mistral-embed',
    'input' => 'A sentence to embed.',
]);

For endpoints with path parameters, a single combined array is the preferred v4 form. Path fields are separated from the request body using the endpoint template:

$mistral->updateAgent([
    'agent_id' => 'ag_abc123',
    'description' => 'Updated description',
]);

The v3 two-array form remains supported for existing integrations:

$mistral->updateAgent(
    ['agent_id' => 'ag_abc123'],
    ['description' => 'Updated description'],
);

For GET and DELETE methods, non-path values become RFC 3986 query parameters. Path parameter values are URL encoded. The explicit form is available when method names are determined at runtime:

$response = $mistral->request(
    'listFiles',
    ['page' => 0, 'page_size' => 20],
    customHeaders: ['X-Trace-Id' => 'trace_abc123'],
);

Streaming

Set stream to true and pass a callback. The decoder supports arbitrarily split chunks, CRLF and LF delimiters, comments, multiline data fields, final unterminated frames, and [DONE].

$mistral->createChatCompletion(
    [
        'model' => 'mistral-small-latest',
        'messages' => [['role' => 'user', 'content' => 'Write a short haiku about PHP.']],
        'stream' => true,
    ],
    static function (array $event): void {
        echo $event['choices'][0]['delta']['content'] ?? '';
    },
);

An ordinary JSON response is still returned when a callback is supplied without requesting an SSE stream. Inherently streaming endpoints select a StreamingClientInterface transport without requiring a body flag.

File Uploads

Multipart endpoints accept readable local file paths. Files are copied as raw bytes into a temporary stream rather than being base64 encoded or assembled in one large PHP string.

$response = $mistral->uploadFile([
    'file' => __DIR__ . '/batch.jsonl',
    'purpose' => 'batch',
]);

Nested non-file values are encoded using bracket notation.

Errors

4xx and 5xx responses throw MistralAIException. The exception keeps the parsed API error, raw response body, response headers, status code, and x-request-id for diagnostics.

use SoftCreatR\MistralAI\Exception\MistralAIException;

try {
    $mistral->retrieveModel(['model_id' => 'missing-model']);
} catch (MistralAIException $exception) {
    error_log(sprintf(
        'Mistral AI request %s failed (%d): %s',
        $exception->getRequestId() ?? 'unknown',
        $exception->getCode(),
        $exception->getMessage(),
    ));
}

PSR-18 transport failures are wrapped in MistralAIException and retain the original exception as getPrevious().

Examples

Examples load the ignored project-level .env through examples/MistralAIFactory.php:

cp .env.example .env
php examples/chat/createChatCompletion.php

Administration examples use MISTRAL_ADMIN_API_KEY. Resource-specific examples read IDs from the variables documented in .env.example.

Supported Methods

The catalog follows the current Mistral AI API reference. Beta endpoints remain grouped by their documented API area, and the v2 Prompts and Skills routes use their endpoint-specific base path automatically.

Prompts

SDK method HTTP route Request body Example
listPrompts GET /v2/prompts none PHP
createPrompt POST /v2/prompts json PHP
retrievePrompt GET /v2/prompts/{prompt_id} none PHP
deletePrompt DELETE /v2/prompts/{prompt_id} none PHP
updatePrompt PATCH /v2/prompts/{prompt_id} json PHP
listPromptVersions GET /v2/prompts/{prompt_id}/versions none PHP
createPromptVersion POST /v2/prompts/{prompt_id}/versions json PHP
retrievePromptVersion GET /v2/prompts/{prompt_id}/versions/{version} none PHP
updatePromptVersionMetadata PATCH /v2/prompts/{prompt_id}/versions/{version} json PHP

Skills

SDK method HTTP route Request body Example
listSkills GET /v2/skills none PHP
createSkill POST /v2/skills json PHP
retrieveSkill GET /v2/skills/{skill_id} none PHP
deleteSkill DELETE /v2/skills/{skill_id} none PHP
updateSkill PATCH /v2/skills/{skill_id} json PHP
listSkillVersions GET /v2/skills/{skill_id}/versions none PHP
createSkillVersion POST /v2/skills/{skill_id}/versions json PHP
retrieveSkillVersion GET /v2/skills/{skill_id}/versions/{version} none PHP
updateSkillVersionMetadata PATCH /v2/skills/{skill_id}/versions/{version} json PHP

Audio

SDK method HTTP route Request body Example
createSpeech POST /v1/audio/speech json PHP
createAudioTranscription POST /v1/audio/transcriptions multipart PHP
createAudioTranscriptionStream POST /v1/audio/transcriptions multipart PHP
listVoices GET /v1/audio/voices none PHP
createVoice POST /v1/audio/voices json PHP
deleteVoice DELETE /v1/audio/voices/{voice_id} none PHP
updateVoice PATCH /v1/audio/voices/{voice_id} json PHP
getVoice GET /v1/audio/voices/{voice_id} none PHP
getVoiceSampleAudio GET /v1/audio/voices/{voice_id}/sample none PHP

Models

SDK method HTTP route Request body Example
listModels GET /v1/models none PHP
retrieveModel GET /v1/models/{model_id} none PHP
deleteModel DELETE /v1/models/{model_id} none PHP
updateFineTunedModel PATCH /v1/fine_tuning/models/{model_id} json PHP
archiveModel POST /v1/fine_tuning/models/{model_id}/archive none PHP
unarchiveModel DELETE /v1/fine_tuning/models/{model_id}/archive none PHP

Conversations

SDK method HTTP route Request body Example
startConversation POST /v1/conversations json PHP
listConversations GET /v1/conversations none PHP
retrieveConversation GET /v1/conversations/{conversation_id} none PHP
deleteConversation DELETE /v1/conversations/{conversation_id} none PHP
appendConversation POST /v1/conversations/{conversation_id} json PHP
listConversationHistory GET /v1/conversations/{conversation_id}/history none PHP
listConversationMessages GET /v1/conversations/{conversation_id}/messages none PHP
restartConversation POST /v1/conversations/{conversation_id}/restart json PHP
startConversationStream POST /v1/conversations json PHP
appendConversationStream POST /v1/conversations/{conversation_id} json PHP
restartConversationStream POST /v1/conversations/{conversation_id}/restart json PHP

Agents

SDK method HTTP route Request body Example
createAgent POST /v1/agents json PHP
listAgents GET /v1/agents none PHP
listAgentPages GET /v1/agents/pages none PHP
retrieveAgent GET /v1/agents/{agent_id} none PHP
updateAgent PATCH /v1/agents/{agent_id} json PHP
deleteAgent DELETE /v1/agents/{agent_id} none PHP
updateAgentVersion PATCH /v1/agents/{agent_id}/version none PHP
listAgentVersions GET /v1/agents/{agent_id}/versions none PHP
retrieveAgentVersion GET /v1/agents/{agent_id}/versions/{version} none PHP
upsertAgentVersionAlias PUT /v1/agents/{agent_id}/aliases none PHP
listAgentVersionAliases GET /v1/agents/{agent_id}/aliases none PHP
deleteAgentVersionAlias DELETE /v1/agents/{agent_id}/aliases none PHP
createAgentsCompletion POST /v1/agents/completions json PHP

Files

SDK method HTTP route Request body Example
uploadFile POST /v1/files multipart PHP
listFiles GET /v1/files none PHP
retrieveFile GET /v1/files/{file_id} none PHP
deleteFile DELETE /v1/files/{file_id} none PHP
downloadFile GET /v1/files/{file_id}/content none PHP
retrieveFileSignedUrl GET /v1/files/{file_id}/url none PHP

Batch

SDK method HTTP route Request body Example
listBatchJobs GET /v1/batch/jobs none PHP
createBatchJob POST /v1/batch/jobs json PHP
retrieveBatchJob GET /v1/batch/jobs/{job_id} none PHP
deleteBatchJob DELETE /v1/batch/jobs/{job_id} none PHP
cancelBatchJob POST /v1/batch/jobs/{job_id}/cancel none PHP

Chat

SDK method HTTP route Request body Example
createChatCompletion POST /v1/chat/completions json PHP

Fim

SDK method HTTP route Request body Example
createFimCompletion POST /v1/fim/completions json PHP

Embeddings

SDK method HTTP route Request body Example
createEmbedding POST /v1/embeddings json PHP

Classifiers

SDK method HTTP route Request body Example
createModeration POST /v1/moderations json PHP
createChatModeration POST /v1/chat/moderations json PHP
createClassification POST /v1/classifications json PHP
createChatClassification POST /v1/chat/classifications json PHP

Ocr

SDK method HTTP route Request body Example
createOcr POST /v1/ocr json PHP

Libraries

SDK method HTTP route Request body Example
listLibraries GET /v1/libraries none PHP
createLibrary POST /v1/libraries json PHP
retrieveLibrary GET /v1/libraries/{library_id} none PHP
deleteLibrary DELETE /v1/libraries/{library_id} none PHP
patchLibrary PATCH /v1/libraries/{library_id} json PHP
updateLibrary PUT /v1/libraries/{library_id} json PHP

Libraries / Documents

SDK method HTTP route Request body Example
listLibraryDocuments GET /v1/libraries/{library_id}/documents none PHP
uploadLibraryDocument POST /v1/libraries/{library_id}/documents multipart PHP
retrieveLibraryDocument GET /v1/libraries/{library_id}/documents/{document_id} none PHP
patchLibraryDocument PATCH /v1/libraries/{library_id}/documents/{document_id} json PHP
updateLibraryDocument PUT /v1/libraries/{library_id}/documents/{document_id} json PHP
deleteLibraryDocument DELETE /v1/libraries/{library_id}/documents/{document_id} none PHP
retrieveLibraryDocumentTextContent GET /v1/libraries/{library_id}/documents/{document_id}/text_content none PHP
retrieveLibraryDocumentStatus GET /v1/libraries/{library_id}/documents/{document_id}/status none PHP
retrieveLibraryDocumentSignedUrl GET /v1/libraries/{library_id}/documents/{document_id}/signed-url none PHP
retrieveLibraryDocumentExtractedTextSignedUrl GET /v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url none PHP
reprocessLibraryDocument POST /v1/libraries/{library_id}/documents/{document_id}/reprocess none PHP

Libraries / Shares

SDK method HTTP route Request body Example
listLibraryShares GET /v1/libraries/{library_id}/share none PHP
upsertLibraryShare PUT /v1/libraries/{library_id}/share json PHP
deleteLibraryShare DELETE /v1/libraries/{library_id}/share json PHP

Observability / Chat Completion Events

SDK method HTTP route Request body Example
getChatCompletionEvents POST /v1/observability/chat-completion-events/search json PHP
getChatCompletionEventIds POST /v1/observability/chat-completion-events/search-ids json PHP
getChatCompletionEvent GET /v1/observability/chat-completion-events/{event_id} none PHP
getSimilarChatCompletionEvents GET /v1/observability/chat-completion-events/{event_id}/similar-events none PHP
judgeChatCompletionEvent POST /v1/observability/chat-completion-events/{event_id}/live-judging json PHP

Observability / Chat Completion Events / Fields

SDK method HTTP route Request body Example
getChatCompletionFields GET /v1/observability/chat-completion-fields none PHP
getChatCompletionFieldOptions GET /v1/observability/chat-completion-fields/{field_name}/options none PHP
getChatCompletionFieldOptionsCounts POST /v1/observability/chat-completion-fields/{field_name}/options-counts json PHP

Observability / Judges

SDK method HTTP route Request body Example
createJudge POST /v1/observability/judges json PHP
getJudges GET /v1/observability/judges none PHP
getJudgeById GET /v1/observability/judges/{judge_id} none PHP
deleteJudge DELETE /v1/observability/judges/{judge_id} none PHP
updateJudge PUT /v1/observability/judges/{judge_id} json PHP
judgeConversation POST /v1/observability/judges/{judge_id}/live-judging json PHP

Observability / Campaigns

SDK method HTTP route Request body Example
createCampaign POST /v1/observability/campaigns json PHP
getCampaigns GET /v1/observability/campaigns none PHP
getCampaignById GET /v1/observability/campaigns/{campaign_id} none PHP
deleteCampaign DELETE /v1/observability/campaigns/{campaign_id} none PHP
getCampaignStatusById GET /v1/observability/campaigns/{campaign_id}/status none PHP
getCampaignSelectedEvents GET /v1/observability/campaigns/{campaign_id}/selected-events none PHP

Observability / Datasets

SDK method HTTP route Request body Example
createDataset POST /v1/observability/datasets json PHP
getDatasets GET /v1/observability/datasets none PHP
getDatasetById GET /v1/observability/datasets/{dataset_id} none PHP
deleteDataset DELETE /v1/observability/datasets/{dataset_id} none PHP
updateDataset PATCH /v1/observability/datasets/{dataset_id} json PHP
getDatasetRecords GET /v1/observability/datasets/{dataset_id}/records none PHP
createDatasetRecord POST /v1/observability/datasets/{dataset_id}/records json PHP
postDatasetRecordsFromCampaign POST /v1/observability/datasets/{dataset_id}/imports/from-campaign json PHP
postDatasetRecordsFromExplorer POST /v1/observability/datasets/{dataset_id}/imports/from-explorer json PHP
postDatasetRecordsFromFile POST /v1/observability/datasets/{dataset_id}/imports/from-file json PHP
postDatasetRecordsFromPlayground POST /v1/observability/datasets/{dataset_id}/imports/from-playground json PHP
postDatasetRecordsFromDataset POST /v1/observability/datasets/{dataset_id}/imports/from-dataset json PHP
exportDatasetToJsonl GET /v1/observability/datasets/{dataset_id}/exports/to-jsonl none PHP
getDatasetImportTask GET /v1/observability/datasets/{dataset_id}/tasks/{task_id} none PHP
getDatasetImportTasks GET /v1/observability/datasets/{dataset_id}/tasks none PHP

Observability / Datasets / Records

SDK method HTTP route Request body Example
getDatasetRecord GET /v1/observability/dataset-records/{dataset_record_id} none PHP
deleteDatasetRecord DELETE /v1/observability/dataset-records/{dataset_record_id} none PHP
deleteDatasetRecords POST /v1/observability/dataset-records/bulk-delete json PHP
judgeDatasetRecord POST /v1/observability/dataset-records/{dataset_record_id}/live-judging json PHP
updateDatasetRecordPayload PUT /v1/observability/dataset-records/{dataset_record_id}/payload json PHP
updateDatasetRecordProperties PUT /v1/observability/dataset-records/{dataset_record_id}/properties json PHP

Observability / Logs

SDK method HTTP route Request body Example
searchLogs POST /v1/observability/logs/search json PHP
getLogFields GET /v1/observability/logs/fields none PHP
getLogFieldOptions GET /v1/observability/logs/fields/{field_name}/options none PHP

Observability / Traces

SDK method HTTP route Request body Example
searchTraces POST /v1/observability/traces/search json PHP
aggregateTraces POST /v1/observability/traces/aggregate json PHP
getTraceFields GET /v1/observability/traces/fields none PHP
getTraceById GET /v1/observability/traces/{trace_id} none PHP
getTraceSpans GET /v1/observability/traces/{trace_id}/spans none PHP
getTraceFieldOptions GET /v1/observability/traces/fields/{field_name}/options none PHP
getSpanById GET /v1/observability/traces/{trace_id}/spans/{span_id} none PHP

Observability / Spans

SDK method HTTP route Request body Example
searchSpans POST /v1/observability/spans/search json PHP
aggregateSpans POST /v1/observability/spans/aggregate json PHP
searchSpanEvaluations POST /v1/observability/spans/evaluations/search json PHP
searchLatestSpanEvaluations POST /v1/observability/spans/evaluations/search/latest json PHP
getSpanFields GET /v1/observability/spans/fields none PHP
getSpanEvaluationFields GET /v1/observability/spans/evaluations/fields none PHP
getSpanFieldOptions GET /v1/observability/spans/fields/{field_name}/options none PHP
getSpanEvaluationFieldOptions GET /v1/observability/spans/evaluations/fields/{field_name}/options none PHP

Connectors

SDK method HTTP route Request body Example
createConnector POST /v1/connectors json PHP
listConnectors GET /v1/connectors none PHP
getConnectorAuthUrl GET /v1/connectors/{connector_id_or_name}/auth_url none PHP
shareConnector PUT /v1/connectors/{connector_id}/share none PHP
unshareConnector DELETE /v1/connectors/{connector_id}/share none PHP
activateForConsumerConnector POST /v1/connectors/{connector_id}/{consumer_scope}/activate none PHP
deactivateForConsumerConnector POST /v1/connectors/{connector_id}/{consumer_scope}/deactivate none PHP
callConnectorTool POST /v1/connectors/{connector_id_or_name}/tools/{tool_name}/call json PHP
listConnectorTools GET /v1/connectors/{connector_id_or_name}/tools none PHP
getConnectorAuthenticationMethods GET /v1/connectors/{connector_id_or_name}/authentication_methods none PHP
listConnectorOrganizationCredentials GET /v1/connectors/{connector_id_or_name}/organization/credentials none PHP
createOrUpdateConnectorOrganizationCredentials POST /v1/connectors/{connector_id_or_name}/organization/credentials json PHP
listConnectorWorkspaceCredentials GET /v1/connectors/{connector_id_or_name}/workspace/credentials none PHP
createOrUpdateConnectorWorkspaceCredentials POST /v1/connectors/{connector_id_or_name}/workspace/credentials json PHP
listConnectorUserCredentials GET /v1/connectors/{connector_id_or_name}/user/credentials none PHP
createOrUpdateConnectorUserCredentials POST /v1/connectors/{connector_id_or_name}/user/credentials json PHP
deleteAllConnectorUserCredentials DELETE /v1/connectors/{connector_id_or_name}/user/credentials none PHP
deleteConnectorOrganizationCredentials DELETE /v1/connectors/{connector_id_or_name}/organization/credentials/{credentials_name} none PHP
deleteConnectorWorkspaceCredentials DELETE /v1/connectors/{connector_id_or_name}/workspace/credentials/{credentials_name} none PHP
deleteConnectorUserCredentials DELETE /v1/connectors/{connector_id_or_name}/user/credentials/{credentials_name} none PHP
retrieveConnector GET /v1/connectors/{connector_id_or_name} none PHP
updateConnector PATCH /v1/connectors/{connector_id} json PHP
deleteConnector DELETE /v1/connectors/{connector_id} none PHP

Workflows / Executions

SDK method HTTP route Request body Example
getWorkflowExecution GET /v1/workflows/executions/{execution_id} none PHP
getWorkflowExecutionHistory GET /v1/workflows/executions/{execution_id}/history none PHP
signalWorkflowExecution POST /v1/workflows/executions/{execution_id}/signals json PHP
queryWorkflowExecution POST /v1/workflows/executions/{execution_id}/queries json PHP
terminateWorkflowExecution POST /v1/workflows/executions/{execution_id}/terminate none PHP
batchTerminateWorkflowExecutions POST /v1/workflows/executions/terminate json PHP
cancelWorkflowExecution POST /v1/workflows/executions/{execution_id}/cancel none PHP
batchCancelWorkflowExecutions POST /v1/workflows/executions/cancel json PHP
resetWorkflow POST /v1/workflows/executions/{execution_id}/reset json PHP
updateWorkflowExecution POST /v1/workflows/executions/{execution_id}/updates json PHP
getWorkflowExecutionTraceInfo GET /v1/workflows/executions/{execution_id}/trace/info none PHP
getWorkflowExecutionTraceOtel GET /v1/workflows/executions/{execution_id}/trace/otel none PHP
getWorkflowExecutionTraceSummary GET /v1/workflows/executions/{execution_id}/trace/summary none PHP
getWorkflowExecutionTraceEvents GET /v1/workflows/executions/{execution_id}/trace/events none PHP
streamWorkflowExecution GET /v1/workflows/executions/{execution_id}/stream none PHP
getWorkflowExecutionLogs GET /v1/workflows/executions/{execution_id}/logs none PHP
streamWorkflowExecutionLogs GET /v1/workflows/executions/{execution_id}/logs/stream none PHP

Workflows / Metrics

SDK method HTTP route Request body Example
getWorkflowMetrics GET /v1/workflows/{workflow_name}/metrics none PHP

Workflows / Runs

SDK method HTTP route Request body Example
listRuns GET /v1/workflows/runs none PHP
getRun GET /v1/workflows/runs/{run_id} none PHP
getRunHistory GET /v1/workflows/runs/{run_id}/history none PHP

Workflows / Schedules

SDK method HTTP route Request body Example
getSchedules GET /v1/workflows/schedules none PHP
scheduleWorkflow POST /v1/workflows/schedules json PHP
getSchedule GET /v1/workflows/schedules/{schedule_id} none PHP
unscheduleWorkflow DELETE /v1/workflows/schedules/{schedule_id} none PHP
updateSchedule PATCH /v1/workflows/schedules/{schedule_id} json PHP
pauseSchedule POST /v1/workflows/schedules/{schedule_id}/pause json PHP
resumeSchedule POST /v1/workflows/schedules/{schedule_id}/resume json PHP
triggerSchedule POST /v1/workflows/schedules/{schedule_id}/trigger json PHP

Workflows / Events

SDK method HTTP route Request body Example
getStreamEvents GET /v1/workflows/events/stream none PHP
getWorkflowEvents GET /v1/workflows/events/list none PHP

Workflows / Deployments

SDK method HTTP route Request body Example
listDeployments GET /v1/workflows/deployments none PHP
createDeployment POST /v1/workflows/deployments json PHP
updateDeployment PATCH /v1/workflows/deployments/{name} json PHP
deleteDeployment DELETE /v1/workflows/deployments/{name} none PHP
getDeployment GET /v1/workflows/deployments/{name} none PHP
stopDeployment POST /v1/workflows/deployments/{name}/stop none PHP
startDeployment POST /v1/workflows/deployments/{name}/start none PHP
restartDeployment POST /v1/workflows/deployments/{name}/restart none PHP
listDeploymentWorkers GET /v1/workflows/deployments/{name}/workers none PHP
getDeploymentLogs GET /v1/workflows/deployments/{name}/logs none PHP
streamDeploymentLogs GET /v1/workflows/deployments/{name}/logs/stream none PHP

Workflows

SDK method HTTP route Request body Example
getWorkflows GET /v1/workflows none PHP
getWorkflowRegistrations GET /v1/workflows/registrations none PHP
executeWorkflow POST /v1/workflows/{workflow_identifier}/execute json PHP
executeWorkflowRegistration POST /v1/workflows/registrations/{workflow_registration_id}/execute json PHP
getWorkflow GET /v1/workflows/{workflow_identifier} none PHP
updateWorkflow PUT /v1/workflows/{workflow_identifier} json PHP
getWorkflowRegistration GET /v1/workflows/registrations/{workflow_registration_id} none PHP
bulkArchiveWorkflows PUT /v1/workflows/archive json PHP
bulkUnarchiveWorkflows PUT /v1/workflows/unarchive json PHP
archiveWorkflow PUT /v1/workflows/{workflow_identifier}/archive none PHP
unarchiveWorkflow PUT /v1/workflows/{workflow_identifier}/unarchive none PHP

Rag / Ingestion

SDK method HTTP route Request body Example
getConfigs GET /v1/rag/ingestion_pipeline_configurations none PHP
registerConfig PUT /v1/rag/ingestion_pipeline_configurations json PHP
updateRunInfo PUT /v1/rag/ingestion_pipeline_configurations/{id}/run_info json PHP

Rag / Search Indexes

SDK method HTTP route Request body Example
getDeploymentSummaries GET /v1/rag/deployments none PHP
registerDeployment PUT /v1/rag/deployments json PHP
unregisterDeployment DELETE /v1/rag/deployments/{deployment_id} none PHP
updateIndexMetrics PUT /v1/rag/deployments/{deployment_id}/metrics json PHP

Users

SDK method HTTP route Request body Example
getIdentity GET /v1/users/me none PHP
listOrganizations GET /v1/users/me/organizations none PHP
listWorkspaces GET /v1/users/me/workspaces none PHP

Administration / Users

SDK method HTTP route Request body Example
listAdminUsers GET /v1/admin/users none PHP
createAdminUsers POST /v1/admin/users json PHP
inviteAdminUsers POST /v1/admin/users-invite json PHP
listAdminInvite GET /v1/admin/users-invite none PHP
deleteAdminInvite DELETE /v1/admin/users-invite/{invite_uuid} none PHP
updateAdminUser PATCH /v1/admin/users/{user_id} json PHP
deleteAdminUser DELETE /v1/admin/users/{user_id} none PHP
retrieveAdminUser GET /v1/admin/users/{user_id} none PHP
listAdminRoles GET /v1/admin/roles none PHP

Administration / Workspaces

SDK method HTTP route Request body Example
listAdminWorkspaces GET /v1/admin/workspaces none PHP
createAdminWorkspace POST /v1/admin/workspaces json PHP
updateAdminWorkspaces PATCH /v1/admin/workspaces/{workspace_uuid} json PHP
deleteAdminWorkspaces DELETE /v1/admin/workspaces/{workspace_uuid} none PHP
addAdminUsersWorkspaces POST /v1/admin/workspaces/{workspace_uuid}/add-users json PHP
addAdminOrUpdateUsersWorkspaces PATCH /v1/admin/workspaces/{workspace_uuid}/users json PHP
removeAdminUsersWorkspaces DELETE /v1/admin/workspaces/{workspace_uuid}/remove-users json PHP

Administration / Billing

SDK method HTTP route Request body Example
listAdminRateLimits GET /v1/admin/rate-limit none PHP
listAdminSpendLimits GET /v1/admin/spend-limit none PHP
updateAdminSpendLimits POST /v1/admin/spend-limit json PHP
listAdminUsage GET /v1/admin/usage none PHP

Administration / Audit Logs

SDK method HTTP route Request body Example
listAdminAuditLogs GET /v1/admin/audit-logs none PHP

Administration / User Groups

SDK method HTTP route Request body Example
listAdminUserGroups GET /v1/admin/user-groups none PHP
createAdminUserGroup POST /v1/admin/user-groups json PHP
provisionAdminGroupToWorkspace POST /v1/admin/user-groups/provision-workspace json PHP
retrieveAdminUserGroup GET /v1/admin/user-groups/{group_uuid} none PHP
updateAdminUserGroup PATCH /v1/admin/user-groups/{group_uuid} json PHP
deleteAdminUserGroup DELETE /v1/admin/user-groups/{group_uuid} none PHP
retrieveAdminUserGroupMembers GET /v1/admin/user-groups/{group_uuid}/members none PHP
assignAdminUsersToGroup POST /v1/admin/user-groups/{group_uuid}/members json PHP
removeAdminUsersFromGroup DELETE /v1/admin/user-groups/{group_uuid}/members json PHP
retrieveAdminGroupWorkspaceAssignments GET /v1/admin/user-groups/{group_uuid}/workspaces none PHP
assignAdminGroupToWorkspace POST /v1/admin/user-groups/{group_uuid}/workspaces json PHP
updateAdminGroupWorkspaceAssignment PATCH /v1/admin/user-groups/{group_uuid}/workspaces/{workspace_uuid} json PHP
removeAdminGroupFromWorkspace DELETE /v1/admin/user-groups/{group_uuid}/workspaces/{workspace_uuid} none PHP
updateAdminUserGroupOrganizationRole PATCH /v1/admin/user-groups/{group_uuid}/organization-role json PHP
retrieveAdminNestedGroupsAdmin GET /v1/admin/user-groups/{group_uuid}/nested none PHP
setAdminNestedGroupsAdmin PATCH /v1/admin/user-groups/{group_uuid}/nested json PHP

Administration / Api Keys

SDK method HTTP route Request body Example
listAdminApiKeys GET /v1/admin/api-keys none PHP
createAdminApiKey POST /v1/admin/api-keys json PHP
deleteAdminApiKey DELETE /v1/admin/api-keys/{key_id} none PHP

Administration / Scim

SDK method HTTP route Request body Example
triggerAdminScimSync POST /v1/admin/scim/sync json PHP
retrieveAdminScimSyncRun GET /v1/admin/scim/sync/{run_id} none PHP

Administration / Vibe Work Analytics

SDK method HTTP route Request body Example
usageAdminByUser GET /v1/admin/analytics/vibe/work/usage/by_user_stats none PHP
usageAdminByAgent GET /v1/admin/analytics/vibe/work/usage/by_agent_stats none PHP
usageAdminOverTime GET /v1/admin/analytics/vibe/work/usage/by_time_stats none PHP

Administration / Vibe Code Analytics

SDK method HTTP route Request body Example
usageAdminByWorkspace GET /v1/admin/analytics/vibe/code/usage/by_workspace none PHP
usageAdminByOrganization GET /v1/admin/analytics/vibe/code/usage/by_organization none PHP

Changelog

See CHANGELOG.md for release history and migration notes.

License

This library is licensed under the ISC License. See LICENSE.md.