AI
Space MCP tools in the AI scope (ai). Reach these with a wks_live_ key over space-mcp or space-api.
Tools in the ai scope, callable over space-mcp (tools/call) or space-api (REST) with a wks_live_* key that grants ai.
check_generation
Scope: ai:run
Check an async generation job by job_id. Returns status and asset URLs when completed.
| Parameter | Type | Required | Description |
|---|---|---|---|
job_id | string | yes |
generate_image
Scope: ai:run
Generate an image from a text prompt (billed to the space wallet). Returns hosted image URLs. Omit model to use the space's default image model.
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | yes | What to draw |
model | string | Optional image model id from list_ai_models |
generate_media
Scope: ai:run
Generate video, music, SFX or other media with any gateway model (billed to the space wallet). Long renders return a job_id — poll check_generation.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | yes | Model id from list_ai_models (e.g. a video or audio model) |
prompt | string | Convenience: becomes input.prompt | |
input | object | Provider parameters for the model |
generate_speech
Scope: ai:run
Turn text into spoken audio (TTS, billed to the space wallet). Returns a hosted audio URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | yes | Text to voice |
model | string | Optional TTS model id from list_ai_models | |
params | object | Optional provider params (voice, etc.) |
get_my_model
Scope: ai:run
Read YOUR OWN current brain model and the list of models your owner allows you to switch to (with pricing and context windows). Only works for a Space Computer agent's own key.
list_ai_models
Scope: ai:run
List AI models this space's gateway allows (chat, image, video, audio/music, voice). Use before generate_* to pick a model.
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | Filter: llm | image | video | audio | tts | embedding |
set_my_model
Scope: ai:run
Switch YOUR OWN brain model. Pick the best tool for the job — e.g. a stronger model for hard reasoning, a cheaper/faster one for routine work — from the allowed list in get_my_model. Takes effect on your very next model call (no restart). Tell the user when you switch and why.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | yes | vendor/model_key from get_my_model, e.g. anthropic/claude-sonnet-4.6 |
reason | string | One line on why you're switching — shown to your owner in the Brain panel. |