GiuliaAPI Documentation

GiuliaAPI exposes radio network simulations to applications and AI agents through a stable workspace model, a REST API, and an MCP-compatible tool interface.

Overview

GiuliaAPI is designed for AI agents that need to inspect, modify, run, and evaluate radio network simulations. It provides a human-readable REST interface, machine-readable tool schemas, and an MCP endpoint for clients that support tool calling through the Model Context Protocol.

Diagram showing that a GiuliaAPI workspace contains simulations
REST API MCP tools Workspace isolation Usage counters
Recommended public model: create a simulation first. GiuliaAPI creates or reuses a workspace automatically, and later calls can use the returned sim_id.
Public deployment: the hosted endpoint is intended for agent interaction and experimentation, not high-throughput batch jobs.

Based on OpenGiuliaSLS

GiuliaAPI is built on top of the open-source OpenGiuliaSLS project. OpenGiuliaSLS provides the underlying radio network simulation engine; GiuliaAPI adds an agent-friendly service layer around it, including HTTP endpoints, MCP tool schemas, workspace lifecycle management, quotas, and usage instrumentation.

This separation is intentional: OpenGiuliaSLS remains the simulation core, while GiuliaAPI focuses on making that core usable by external agents, applications, scripts, and notebooks.

Core Concepts

Workspace

An isolated container for one task, workflow, or analysis. A workspace owns simulations, counters, quotas, and transient state.

Simulation

A configured radio scenario. Simulations can be created, cloned, modified, executed, queried, and deleted inside a workspace.

Episode

One realization of the simulated environment, such as user placement or traffic state. Many KPIs aggregate over episodes.

Step

A time or execution unit inside a run. Quotas often use episodes multiplied by steps as the resource unit.

Parameters

Engineering or UE values that agents can inspect and modify before running a simulation.

Results

KPI outputs from completed simulations, available as raw or aggregated data depending on the endpoint.

Authentication

Authenticated deployments expect an API key in the X-API-Key header. For simple workflows, GiuliaAPI creates or reuses a workspace automatically. Advanced clients may pass X-Workspace-ID explicitly to select a specific workspace.

HeaderPurpose
X-API-KeyIdentifies the principal making the request and applies scopes, limits, and quotas.
X-Workspace-IDOptional for advanced workflows. Selects a specific workspace when multiple workspaces are active.

API Key Permissions

API keys can be configured with different permissions depending on the deployment. A key may be allowed to create workspaces, run simulations, inspect results, or all of these.

  • Workspace permissions: create, inspect, list, or delete workspaces.
  • Simulation permissions: create simulations, update parameters, run simulations, and read results.

REST Quickstart

Create a simulation with your API key.
Use the returned sim_id on later calls.
Configure parameters before running, if needed.
Run simulations and query results.
Use explicit workspace endpoints only when you need lifecycle control.

curl

BASE="https://nicopi-giuliaapi.hf.space"
API_KEY="your-api-key"

SIM_ID=$(curl -s -X POST "$BASE/api/create_simulation" \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"scenario_model":"ITU_R_M2135_UMa","ue_distribution":"uniform","link_direction":"downlink","number_of_episodes":1}' \
  | python -c "import sys,json; print(json.load(sys.stdin)['sim_id'])")

curl -s -X POST "$BASE/api/run_simulation" \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"sim_id\":\"$SIM_ID\"}"

Python

import requests

base = "https://nicopi-giuliaapi.hf.space"
headers = {"X-API-Key": "your-api-key"}

# Create a simulation in your API-key workspace.
sim = requests.post(f"{base}/api/create_simulation", headers=headers, json={
    "scenario_model": "ITU_R_M2135_UMa",
    "ue_distribution": "uniform",
    "link_direction": "downlink",
    "number_of_episodes": 1,
}).json()

# Run the latest simulation in that workspace.
requests.post(f"{base}/api/run_simulation", headers=headers)

# Read aggregated results from the latest simulation.
results = requests.post(f"{base}/api/get_aggregated_results", headers=headers, json={
    "kpis": ["ue_throughput_Mbps"],
    "group_by": "all",
    "metrics": ["mean"],
}).json()
print(results)

MCP

The MCP endpoint is available at /mcp. It exposes Giulia simulation operations as tools using JSON-RPC over the MCP transport.

MCP clients generally call initialize, then tools/list, then tools/call. Workspace binding is handled by headers, transport session metadata, or server-side binding. Tool arguments should describe the simulation operation, not workspace management.

Important: agents should not include workspace identifiers in tool arguments. Workspace identity is managed by the API layer.
ModeHow workspace is chosenUse case
REST simple modeAutomatic workspace plus sim_id routingApplications, scripts, notebooks, custom clients.
REST workspace modeX-Workspace-ID headerAdvanced workflows with multiple active workspaces.
MCP attached workspaceTransport/session binding or server-side auto-bindingClaude, ChatGPT, Codex, and other MCP clients.
Mixed REST/MCPSame workspace ID or server mapping from simulation IDsAdvanced workflows that combine application control and agent tools.

Usage Counters

GiuliaAPI records workspace-level counters so clients can monitor API usage and simulation activity.

CounterMeaning
call_countTotal counted API calls in the workspace.
created_simulation_countNumber of simulations created in the workspace.
run_simulation_countNumber of valid run attempts.
completed_simulation_countNumber of simulations that completed successfully.
completed_episode_countTotal completed episodes across successful runs.
active_simulation_countCurrent number of simulations retained in the workspace.

Endpoint Reference

CategoryEndpointDescription
WorkspacePOST /api/create_workspaceCreate an isolated workspace.
WorkspaceGET /api/workspaces/{workspace_id}Read workspace metadata and counters.
WorkspaceGET /api/workspacesList active workspaces when permitted.
WorkspaceDELETE /api/workspaces/{workspace_id}Delete a workspace and release its state.
SimulationPOST /api/create_simulationCreate a simulation from scenario parameters.
SimulationPOST /api/list_simulationsList simulations in a workspace.
SimulationPOST /api/clone_simulationClone an existing simulation.
SimulationPOST /api/delete_simulationDelete a simulation.
ParametersPOST /api/get_engineering_parametersInspect engineering parameters.
ParametersPOST /api/set_engineering_parameterModify engineering parameters.
Carrier managementPOST /api/get_carrier_management_configInspect cell roles, pairings, and shutdown settings.
Carrier managementPOST /api/set_carrier_management_configModify carrier-management settings before running.
ParametersPOST /api/get_ue_parametersInspect UE parameters.
ParametersPOST /api/set_ue_parameterModify UE parameters.
ExecutionPOST /api/run_simulationExecute a simulation.
ResultsPOST /api/get_resultsReturn result data.
ResultsPOST /api/get_aggregated_resultsReturn aggregated KPI data.
ToolsGET /toolsFull capability manifest.
ToolsGET /tools/openaiTool schemas in OpenAI format.
ToolsGET /tools/anthropicTool schemas in Anthropic format.
ToolsGET /tools/textPlain-text tool reference for prompt injection.
MCPPOST /mcpMCP JSON-RPC endpoint.