AI on demand: openai/gpt-oss-120b

From MediaWiki
Revision as of 16:24, 2 September 2026 by Sst-yde (talk | contribs) (Created page with "== Calling the model == <syntaxhighlight lang="bash"> # Set your personal key: STONEY_KEY=sk-... # Set the desired model: MODEL=openai/gpt-oss-120b # Set your prompt: PROMPT='Hello.' # Set maximum amount of tokens: MAX_TOKENS=100 curl https://llm.stoney-cloud.com/v1/chat/completions \ --silent --fail --show-error \ --header "Authorization: Bearer $STONEY_KEY" \ --header 'Content-Type: application/json' \ --data '{ "mo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Calling the model

# Set your personal key:
STONEY_KEY=sk-...

# Set the desired model:
MODEL=openai/gpt-oss-120b

# Set your prompt:
PROMPT='Hello.'

# Set maximum amount of tokens:
MAX_TOKENS=100

curl https://llm.stoney-cloud.com/v1/chat/completions \
        --silent --fail --show-error \
        --header "Authorization: Bearer $STONEY_KEY" \
        --header 'Content-Type: application/json'   \
        --data '{
                "model": "'"$MODEL"'",
                "messages": [
                        {"role": "user", "content": "'"$PROMPT"'"}
                ],
                "max_tokens": '"$MAX_TOKENS"'
        }' \
        | jq

Example output:

{
  "id": "chatcmpl-a7415d610c007432",
  "object": "chat.completion",
  "created": 1788358983,
  "model": "openai/gpt-oss-120b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! 👋 How can I help you today?",
        "refusal": null,
        "annotations": null,
        "audio": null,
        "function_call": null,
        "reasoning": "User just says \"Hello.\" Likely expecting a greeting. So respond friendly and ask how can help."
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null,
      "token_ids": null,
      "routed_experts": null
    }
  ],
  "service_tier": null,
  "system_fingerprint": "vllm-0.27.1-tp8-2c775da9",
  "usage": {
    "prompt_tokens": 69,
    "total_tokens": 111,
    "completion_tokens": 42,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null,
  "prompt_token_ids": null,
  "prompt_text": null,
  "kv_transfer_params": null,
  "ec_transfer_params": null,
  "metrics": null
}