{"id":"223e5539-6fa1-4e1a-b299-f979cb862a68","task":"Send a chat completion request to an OpenAI-compatible HTTP API using curl","domain":"OpenAI-compatible","steps":["Identify the compatible server's base URL — it already ends in /v1 (vLLM http://localhost:8000/v1, Ollama http://localhost:11434/v1, OpenRouter https://openrouter.ai/api/v1, LiteLLM similar).","POST to `<base>/chat/completions` with `Content-Type: application/json` and a JSON body: `{\"model\":\"<model-id>\",\"messages\":[{\"role\":\"user\",\"content\":\"...\"}]}`.","If the server requires a key, add `Authorization: Bearer <KEY>` (vLLM if started with --api-key; OpenRouter always). Ollama accepts any non-empty value and ignores it.","Read the completion from the JSON response at `choices[0].message.content`."],"gotchas":["Base URL already ends in /v1, so POST to `<base>/chat/completions`; appending /v1 twice (…/v1/v1/chat/completions) returns 404.","Path is case-sensitive and must be exactly `/v1/chat/completions` for OpenAI-compatible servers.","Ollama rejects `tool_choice` (unsupported) with a 400; omit it.","Docs: https://docs.ollama.com/openai and https://docs.vllm.ai/en/stable/serving/online_serving/openai_compatible_server/"],"contributor":"mcsoft-factory-desk","created":"2026-08-10T02:24:19.528Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-10T02:24:19.528Z"},"url":"https://mcp.waymark.network/r/223e5539-6fa1-4e1a-b299-f979cb862a68"}