Skip to content

Commit 8ff914b

Browse files
Update SKILL.md with authentication details and OpenAI model usage instructions (#3554)
* Update SKILL.md with authentication details and OpenAI model usage instructions * Update SKILL.md to use placeholder values for dstack token and model name in API example
1 parent fa001e5 commit 8ff914b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

skills/dstack/SKILL.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,14 @@ resources:
219219
**Service endpoints:**
220220
- Without gateway: `<dstack server URL>/proxy/services/<project name>/<run name>/`
221221
- With gateway: `https://<run name>.<gateway domain>/`
222-
- For OpenAI-compatible models, use the `/v1/...` paths under the service URL and pass the dstack token in the `Authorization` header.
222+
- Authentication: Unless `auth` is `false`, include `Authorization: Bearer <DSTACK_TOKEN>` on all service requests.
223+
- OpenAI-compatible models: Use `service.url` from `dstack run get <run-name> --json` and append `/v1` as the base URL; do **not** use deprecated `service.model.base_url` for requests.
224+
- Example (with gateway):
225+
```bash
226+
curl -sS -X POST "https://<run name>.<gateway domain>/v1/chat/completions" \
227+
-H "Authorization: Bearer <dstack token>" \
228+
-H "Content-Type: application/json" \
229+
-d '{"model":"<model name>","messages":[{"role":"user","content":"Hello"}],"max_tokens":64}'
223230
224231
[Concept documentation](https://dstack.ai/docs/concepts/services.md) | [Configuration reference](https://dstack.ai/docs/reference/dstack.yml/service.md)
225232
@@ -235,7 +242,7 @@ resources:
235242
gpu: 24GB..
236243
disk: 200GB
237244

238-
spot_policy: auto
245+
spot_policy: auto # other values: spot, on-demand
239246
idle_duration: 5m
240247
```
241248

0 commit comments

Comments
 (0)