Sprite Services /create endpoint fails with "Failed to create service [name] (400): service name required"

Trying out the Sprite services endpoint. Even if I pass the correct url with both sprite name and service name, I get the error:

Failed to create service openclaw (400): service name required

Am I supposed to pass the service name also in the body in addition to URL?

I am sending a PUT to ${SPRITES_API_URL}/sprites/${spriteName}/services/${serviceName}

I tried POST but method is not allowed.

I tried passing nameand nameServicein the body but it doesn’t solve it.

I always get the same error message, for example if I call /sprites/mysprite/services/openclaw it will fail with:

Failed to create service openclaw (400): service name required

It seems it does pick up the service name, but it still fails.

We’re running into the same service name required 400 error on PUT /v1/sprites/{name}/services/{name}. Tried every combination of body fields, with and without name in the body, different service names — always the same error.

1 Like

Also hitting this issue. Have tried everything but no dice.

1 Like

Same here. Stuck on this issue

1 Like

Looks like there’s a new way to do this. sprite-env services from within the sprite can manage services Working with Sprites | Sprites

1 Like

Here’s how i fixed it in the end:

const createSvc = await spriteExec(
name,
sprite-env services create openclaw --cmd zsh --args '-c,source ~/.zshrc && cd ${openclawDir} && pnpm openclaw gateway --bind lan'
);


The helper function is:

async function spriteExec(
spriteName: string,
cmd: string,
options?: { env?: Record<string, string>; dir?: string }
): Promise {
const params = new URLSearchParams();
params.append(‘cmd’, ‘zsh’);
params.append(‘cmd’, ‘-c’);
params.append(‘cmd’, cmd);
params.append(‘path’, ‘zsh’);
if (options?.dir) params.append(‘dir’, options.dir);
if (options?.env) {
for (const [key, value] of Object.entries(options.env)) {
params.append(‘env’, ${key}=${value});
}
}
const response = await fetch(
${SPRITES_API_URL}/sprites/${spriteName}/exec?${params.toString()},
{
method: ‘POST’,
headers: { ‘Authorization’: Bearer ${SPRITES_API_TOKEN} },
}
);
const stdout = await response.text();
if (!response.ok) {
throw new Error(Sprite exec failed (${response.status}): ${stdout});
}
const exitCode = parseInt(response.headers.get(‘x-exit-code’) || ‘0’, 10);
return { exitCode, stdout, stderr: ‘’ };
}

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.