Wolf API

Wolf exposes a REST API that allows you to interact with the platform programmatically.
The API can be accessed only via UNIX sockets, you can control the exact path by setting the WOLF_SOCKET_PATH environment variable. If you want to access the socket from outside the container, you should mount the socket to the host machine, ex: -e WOLF_SOCKET_PATH=/var/run/wolf/wolf.sock and -v /var/run/wolf:/var/run/wolf will allow you to access the socket from the host machine at /var/run/wolf/wolf.sock.

You can test out the API using the curl command, for example, to get the OpenAPI specification you can run:

curl --unix-socket /var/run/wolf/wolf.sock http://localhost/api/v1/openapi-schema
bash

When looking at the examples in the API Reference remember to add the --unix-socket flag to the curl command.

Exposing the API via TCP

Exposing the API is highly dangerous, via the API you can pair clients to the server, execute arbitrary commands, and more.
Make sure to secure the API properly if you decide to expose it.

If you want to expose the API via TCP you can use a reverse proxy like nginx, for example, to expose the API on port 8080 you can use the following config

server {
    listen 8080;

    location / {
        proxy_pass http://unix:/var/run/wolf/wolf.sock;
        proxy_http_version 1.0;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Save it as wolf.conf and start an Nginx container with the following command:

docker run --name wolf-proxy \
           --network=host \
           -v /var/run/wolf/wolf.sock:/var/run/wolf/wolf.sock:rw \
           -v ./wolf.conf:/etc/nginx/conf.d/wolf.conf:ro \
           nginx
bash

You can now access the API via http://localhost:8080, ex:

curl localhost:8080/api/v1/openapi-schema
bash

API Reference

v0.1
OAS 3.1.0

Wolf API

API for the Wolf server

Server: http://localhost

Local development server

Client Libraries

Get all apps

This endpoint returns a list of all apps.

Responses
  • application/json
Request Example forGET/api/v1/apps
curl http://localhost/api/v1/apps
{
  "apps": [
    {
      "av1_gst_pipeline": "…",
      "h264_gst_pipeline": "…",
      "hevc_gst_pipeline": "…",
      "icon_png_path": "…",
      "id": "…",
      "opus_gst_pipeline": "…",
      "render_node": "…",
      "runner": {
        "run_cmd": "…",
        "type": "process"
      },
      "start_audio_server": true,
      "start_virtual_compositor": true,
      "support_hdr": true,
      "title": "…"
    }
  ],
  "success": true
}

Get paired clients

This endpoint returns a list of all paired clients.

Responses
  • application/json
Request Example forGET/api/v1/clients
curl http://localhost/api/v1/clients
{
  "clients": [
    {
      "app_state_folder": "…",
      "client_id": 1
    }
  ],
  "success": true
}

Subscribe to events

This endpoint allows clients to subscribe to events using SSE

Request Example forGET/api/v1/events
curl http://localhost/api/v1/events

Return this OpenAPI schema as JSON

Request Example forGET/api/v1/openapi-schema
curl http://localhost/api/v1/openapi-schema

Get pending pair requests

This endpoint returns a list of Moonlight clients that are currently waiting to be paired.

Responses
  • application/json
Request Example forGET/api/v1/pair/pending
curl http://localhost/api/v1/pair/pending
{
  "requests": [
    {
      "pair_secret": "…",
      "pin": "…"
    }
  ],
  "success": true
}

Get all stream sessions

This endpoint returns a list of all active stream sessions.

Responses
  • application/json
Request Example forGET/api/v1/sessions
curl http://localhost/api/v1/sessions
{
  "sessions": [
    {
      "app_id": "…",
      "audio_channel_count": 1,
      "client_id": "…",
      "client_ip": "…",
      "client_settings": {
        "controllers_override": [
          "XBOX"
        ],
        "h_scroll_acceleration": 1,
        "mouse_acceleration": 1,
        "run_gid": 1,
        "run_uid": 1,
        "v_scroll_acceleration": 1
      },
      "video_height": 1,
      "video_refresh_rate": 1,
      "video_width": 1
    }
  ],
  "success": true
}

Add an app

Body
application/json
  • av1_gst_pipeline
    Type:string
    required
  • h264_gst_pipeline
    Type:string
    required
  • hevc_gst_pipeline
    Type:string
    required
  • icon_png_path
    Type:string | nullable
  • id
    Type:string
    required
  • opus_gst_pipeline
    Type:string
    required
  • render_node
    Type:string
    required
  • runner
    required
    Any of
    • run_cmd
      Type:string
      required
    • type
      const: 
      process
      required
      • process
  • start_audio_server
    Type:boolean
    required
  • start_virtual_compositor
    Type:boolean
    required
  • support_hdr
    Type:boolean
    required
  • title
    Type:string
    required
Responses
  • application/json
  • application/json
Request Example forPOST/api/v1/apps/add
curl http://localhost/api/v1/apps/add \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "av1_gst_pipeline": "",
  "h264_gst_pipeline": "",
  "hevc_gst_pipeline": "",
  "icon_png_path": "",
  "id": "",
  "opus_gst_pipeline": "",
  "render_node": "",
  "runner": {
    "run_cmd": "",
    "type": "process"
  },
  "start_audio_server": true,
  "start_virtual_compositor": true,
  "support_hdr": true,
  "title": ""
}'
{
  "success": true
}

Models