← back to slashed.pro /SLASHEDDOCS Get key →
// Docs · Endpoints

Two endpoints. OpenAI-compat shape.

All paths live under /v1. Request and response bodies follow the OpenAI v1 spec; SLASHED proxies the upstream model's contract. If the OpenAI SDK or any third-party OpenAI-compatible library can call OpenAI, it can call SLASHED with a one-string base-URL swap.

// Documented surface, today Only the endpoints listed on this page are documented today. The base path is https://api.slashed.pro/v1. Anything else under /v1/* returns 405 Method Not Allowed or 404 Not Found — expand carefully.

01Endpoint summary

MethodPathAuthPurpose
POST/v1/chat/completionsBearer sl-Chat completion. Streaming, tool use, vision per upstream model capability.
GET/v1/modelsNoneList of all routed models. Returns OpenAI-spec list shape.

02POST /v1/chat/completions

POST /v1/chat/completions

Single chat completion. Same body shape as api.openai.com/v1/chat/completions. The model field selects the upstream provider; SLASHED routes accordingly.

// Required headers
// Required body fields
  • model — One of the IDs in /docs/models.
  • messages — Array of {role, content}. Same shape as OpenAI.
// Common optional fields
  • stream (boolean) — If true, returns Server-Sent Events. See §03 below.
  • tools (array) — Function-calling tool specs. Same shape as OpenAI tool-use. Forwarded as upstream supports it.
  • tool_choice (string | object) — "auto", "none", or a forced selector.
  • temperature, top_p, max_tokens, stop, seed, response_format — standard sampling controls. Forwarded as upstream supports.
// Request example
POST /v1/chat/completions Authorization: Bearer sl-... Content-Type: application/json { "model": "gpt-5.4-mini", "messages": [ {"role": "system", "content": "You are concise."}, {"role": "user", "content": "In one word, reply: ready"} ], "temperature": 0.2, "max_tokens": 16 }
// Response (non-stream)
// 200 OK · Content-Type: application/json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1779280000, "model": "gpt-5.4-mini", "choices": [ { "index": 0, "message": {"role": "assistant", "content": "ready"}, "finish_reason": "stop" } ], "usage": {"prompt_tokens": 23, "completion_tokens": 1, "total_tokens": 24} }

03Streaming

Set "stream": true in the request body. The response is Server-Sent Events. Each data: line is a JSON object with the same delta shape as OpenAI's chat.completion.chunk. The stream terminates with data: [DONE].

# Documented: identical to OpenAI's SSE format data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant"}}]} data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"re"}}]} data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"ady"}}]} data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]} data: [DONE]

The OpenAI Python SDK consumes this transparently — for chunk in client.chat.completions.create(..., stream=True) works.

04Tool use

Pass an OpenAI-spec tools array. The gateway forwards the array unchanged to the upstream provider. When the upstream model emits a tool-call, the gateway returns it in choices[0].message.tool_calls as in OpenAI's contract.

{ "model": "claude-opus-4-7", "messages": [{"role": "user", "content": "What's the weather in NYC?"}], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Get the weather for a city.", "parameters": { "type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"] } } } ] }

Multi-turn tool use follows the OpenAI pattern: append the assistant message containing tool_calls, then append a {"role": "tool", "tool_call_id": "...", "content": "..."} message and re-request.

05Vision

For vision-capable models (see /docs/models), use the OpenAI content-array shape:

{ "model": "gpt-5.4-mini", "messages": [ { "role": "user", "content": [ {"type": "text", "text": "What's in this image?"}, {"type": "image_url", "image_url": {"url": "https://example.com/cat.jpg"}} ] } ] }

Both remote URLs and inline base64 data-URIs are documented as accepted. Image-size limits follow the upstream provider's posted limits.

06GET /v1/models

GET /v1/models

Public listing of all model IDs the gateway routes to. No authentication required. See /docs/models for the documented data on each entry.

curl https://api.slashed.pro/v1/models

Returns OpenAI-spec { "object": "list", "data": [...] } shape. Each entry has id, object, created (0 today), and owned_by.

07What's not documented yet

// "Documented" not "guaranteed" Everything on this page is documented as the current contract. Streaming chunk cadence, tool-call surface delays, and image-encoding edge cases follow the upstream provider's contract — the gateway forwards but does not synthesize. If you need a hard guarantee, raise it before integration.