API Reference
Get impact metrics for a task
Integrations
API Reference
- GETGet status
- POSTGet impact metrics for a task
- POSTCalculate AI model impact metrics for BigQuery
- Manage models
- Manage GPUs
- Manage nodes
- Manage datacenters
API Reference
Get impact metrics for a task
POST
/
v1
/
impact
curl --request POST \
--url https://aiapi.scope3.com/v1/impact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"rows": [
{
"utc_datetime": "2022-01-01T00:00:00Z",
"request_duration_ms": 283,
"processing_duration_ms": 238,
"request_cost": 0.18,
"currency": "USD",
"integration_source": "litellm",
"environment": "staging",
"session_id": "<string>",
"trace_id": "<string>",
"request_id": "<string>",
"client_id": "<string>",
"project_id": "<string>",
"application_id": "<string>",
"model_id": "llama_31_8b",
"model_family": "llama",
"model_name": "LLaMa v3.1 8B",
"model_hugging_face_path": "meta/llama31_8b",
"model_used_id": "llama_31_8b_0125",
"base_url": "https://openrouter.ai/api/v1/chat/completions",
"cloud_region": "us-east-1",
"managed_service_id": "aws-bedrock",
"cloud_id": "aws",
"cloud_instance_id": "p4d.24xlarge",
"node_id": "aws:p4d.24xlarge",
"datacenter_id": "550e8400-e29b-41d4-a716-446655440000",
"country": "US",
"region": "NY",
"task": "text-generation",
"input_tokens": 128,
"input_audio_seconds": 60,
"output_tokens": 128,
"input_images": [
"1024x1024"
],
"input_steps": 50,
"output_images": [
"1024x1024"
],
"output_audio_seconds": 60,
"output_audio_tokens": 2300,
"output_video_frames": 60,
"output_video_resolution": 1080
}
]
}'
{
"rows": [
{
"inference_impact": {
"usage_energy_wh": 0.13,
"usage_emissions_gco2e": 0.81,
"usage_water_ml": 1.32,
"embodied_emissions_gco2e": 0.81,
"embodied_water_ml": 1.32
},
"training_impact": {
"usage_energy_wh": 0.13,
"usage_emissions_gco2e": 0.81,
"usage_water_ml": 1.32,
"embodied_emissions_gco2e": 0.81,
"embodied_water_ml": 1.32
},
"fine_tuning_impact": {
"usage_energy_wh": 0.13,
"usage_emissions_gco2e": 0.81,
"usage_water_ml": 1.32,
"embodied_emissions_gco2e": 0.81,
"embodied_water_ml": 1.32
},
"total_impact": {
"usage_energy_wh": 0.13,
"usage_emissions_gco2e": 0.81,
"usage_water_ml": 1.32,
"embodied_emissions_gco2e": 0.81,
"embodied_water_ml": 1.32
},
"debug": {
"model": {
"id": "gpt-4-turbo",
"aliases": [
"claude-latest",
"claude-3-sonnet-current"
],
"name": "GPT-4 Turbo",
"family": "gpt",
"hugging_face_path": "EleutherAI/gpt-neo-2.7B",
"benchmark_model_id": "GPTJ-6B",
"total_params_billions": 175,
"number_of_experts": 7,
"number_of_active_experts": 2,
"params_per_expert_billions": 8,
"tensor_parallelism": 1,
"datatype": "fp8",
"task": "text-generation",
"training_usage_energy_kwh": 1013.1,
"training_usage_emissions_kgco2e": 1013.1,
"training_usage_water_l": 1013.1,
"training_embodied_emissions_kgco2e": 11013.1,
"training_embodied_water_l": 11013.1,
"estimated_use_life_days": 1013.1,
"estimated_requests_per_day": 1013.1,
"fine_tuned_from_model_id": "llama_31_8b",
"customer_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>"
},
"hardware_node": {
"id": "my-custom-node-1",
"cloud_id": "aws",
"cloud_instance_id": "a2-highgpu-1g",
"managed_service_id": "aws-bedrock",
"gpu_id": "a100_40gb",
"gpu_count": 8,
"cpu_count": 2,
"idle_power_w_ex_gpu": 100,
"average_utilization_rate": 0.8,
"embodied_emissions_kgco2e_ex_gpu": 2500,
"embodied_water_l_ex_gpu": 2500,
"use_life_years": 5,
"customer_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>"
},
"grid_mix": {
"country": "US",
"region": "NY",
"gco2e_per_kwh": 475
},
"steps": [
{
"description": "<string>",
"duration_ms": 123,
"inferences": 123
}
]
},
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"reason": "<string>",
"field": "<string>"
}
}
}
],
"total_energy_wh": 0.13,
"total_gco2e": 0.81,
"total_mlh2o": 1.32,
"has_errors": false
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Return debug information
Body
application/json
Response
200
application/json
Impact metrics retrieved successfully
The response is of type object
.
curl --request POST \
--url https://aiapi.scope3.com/v1/impact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"rows": [
{
"utc_datetime": "2022-01-01T00:00:00Z",
"request_duration_ms": 283,
"processing_duration_ms": 238,
"request_cost": 0.18,
"currency": "USD",
"integration_source": "litellm",
"environment": "staging",
"session_id": "<string>",
"trace_id": "<string>",
"request_id": "<string>",
"client_id": "<string>",
"project_id": "<string>",
"application_id": "<string>",
"model_id": "llama_31_8b",
"model_family": "llama",
"model_name": "LLaMa v3.1 8B",
"model_hugging_face_path": "meta/llama31_8b",
"model_used_id": "llama_31_8b_0125",
"base_url": "https://openrouter.ai/api/v1/chat/completions",
"cloud_region": "us-east-1",
"managed_service_id": "aws-bedrock",
"cloud_id": "aws",
"cloud_instance_id": "p4d.24xlarge",
"node_id": "aws:p4d.24xlarge",
"datacenter_id": "550e8400-e29b-41d4-a716-446655440000",
"country": "US",
"region": "NY",
"task": "text-generation",
"input_tokens": 128,
"input_audio_seconds": 60,
"output_tokens": 128,
"input_images": [
"1024x1024"
],
"input_steps": 50,
"output_images": [
"1024x1024"
],
"output_audio_seconds": 60,
"output_audio_tokens": 2300,
"output_video_frames": 60,
"output_video_resolution": 1080
}
]
}'
{
"rows": [
{
"inference_impact": {
"usage_energy_wh": 0.13,
"usage_emissions_gco2e": 0.81,
"usage_water_ml": 1.32,
"embodied_emissions_gco2e": 0.81,
"embodied_water_ml": 1.32
},
"training_impact": {
"usage_energy_wh": 0.13,
"usage_emissions_gco2e": 0.81,
"usage_water_ml": 1.32,
"embodied_emissions_gco2e": 0.81,
"embodied_water_ml": 1.32
},
"fine_tuning_impact": {
"usage_energy_wh": 0.13,
"usage_emissions_gco2e": 0.81,
"usage_water_ml": 1.32,
"embodied_emissions_gco2e": 0.81,
"embodied_water_ml": 1.32
},
"total_impact": {
"usage_energy_wh": 0.13,
"usage_emissions_gco2e": 0.81,
"usage_water_ml": 1.32,
"embodied_emissions_gco2e": 0.81,
"embodied_water_ml": 1.32
},
"debug": {
"model": {
"id": "gpt-4-turbo",
"aliases": [
"claude-latest",
"claude-3-sonnet-current"
],
"name": "GPT-4 Turbo",
"family": "gpt",
"hugging_face_path": "EleutherAI/gpt-neo-2.7B",
"benchmark_model_id": "GPTJ-6B",
"total_params_billions": 175,
"number_of_experts": 7,
"number_of_active_experts": 2,
"params_per_expert_billions": 8,
"tensor_parallelism": 1,
"datatype": "fp8",
"task": "text-generation",
"training_usage_energy_kwh": 1013.1,
"training_usage_emissions_kgco2e": 1013.1,
"training_usage_water_l": 1013.1,
"training_embodied_emissions_kgco2e": 11013.1,
"training_embodied_water_l": 11013.1,
"estimated_use_life_days": 1013.1,
"estimated_requests_per_day": 1013.1,
"fine_tuned_from_model_id": "llama_31_8b",
"customer_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>"
},
"hardware_node": {
"id": "my-custom-node-1",
"cloud_id": "aws",
"cloud_instance_id": "a2-highgpu-1g",
"managed_service_id": "aws-bedrock",
"gpu_id": "a100_40gb",
"gpu_count": 8,
"cpu_count": 2,
"idle_power_w_ex_gpu": 100,
"average_utilization_rate": 0.8,
"embodied_emissions_kgco2e_ex_gpu": 2500,
"embodied_water_l_ex_gpu": 2500,
"use_life_years": 5,
"customer_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>"
},
"grid_mix": {
"country": "US",
"region": "NY",
"gco2e_per_kwh": 475
},
"steps": [
{
"description": "<string>",
"duration_ms": 123,
"inferences": 123
}
]
},
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"reason": "<string>",
"field": "<string>"
}
}
}
],
"total_energy_wh": 0.13,
"total_gco2e": 0.81,
"total_mlh2o": 1.32,
"has_errors": false
}