Integrations
API Reference
- GETGet status
- POSTGet impact metrics for a task
- POSTCalculate AI model impact metrics for BigQuery
- Manage models
- Manage GPUs
- Manage nodes
Get impact metrics for a task
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,
"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
The start time of the request in UTC
"2022-01-01T00:00:00Z"
The time the request took (as measured by client or proxy)
283
The time taken in processing the request (as measured at execution)
238
The cost to execute this request
0.18
The currency for the cost data
"USD"
The integration used to source the data
"litellm"
Environment (prod/production indicates production)
"staging"
The ID of the session (multiple requests)
The trace ID of the request (multiple requests in one task)
The unique identifier of this request
The client to attribute this call to
The project to attribute this call to
The application to attribute this call to
The ID of the model requested
"llama_31_8b"
The family of the model
"llama"
The name of the model
"LLaMa v3.1 8B"
The Hugging Face path of the model
"meta/llama31_8b"
The ID of the model that did the inference
"llama_31_8b_0125"
The URL of the model endpoint
"https://openrouter.ai/api/v1/chat/completions"
Cloud region as defined by the Scope3 API
1 - 64
"us-east-1"
Managed Service Provider ID
3 - 64
"aws-bedrock"
Cloud ID as defined by the Scope3 API
1 - 64
"aws"
The instance type in the cloud
"p4d.24xlarge"
The ID of a custom or global node
"aws:p4d.24xlarge"
The ID of a specific datacenter, either custom or predefined
"550e8400-e29b-41d4-a716-446655440000"
Two-letter country code as defined by ISO 3166-1 alpha-2
2
"US"
Two-letter region code as defined by ISO 3166-1 alpha-2
2
"NY"
Common types of AI/ML models and their primary functions:
- Text-based models for natural language processing
- Vision models for image analysis and generation
- Audio models for speech and sound processing
- Multimodal models that combine different types of inputs/outputs
- Specialized models for specific use cases
text-generation
, chat
, text-embedding
, text-classification
, sentiment-analysis
, named-entity-recognition
, question-answering
, summarization
, translation
, image-classification
, object-detection
, image-segmentation
, image-generation
, image-to-text
, text-to-image
, style-transfer
, face-detection
, facial-recognition
, speech-to-text
, text-to-speech
, speaker-identification
, audio-classification
, music-generation
, multimodal-embedding
, multimodal-generation
, visual-question-answering
, recommendation-system
, reinforcement-learning
, anomaly-detection
, time-series-forecasting
, clustering
the number of input (or prompt) tokens
0 <= x <= 100000000
128
the duration of audio input in seconds
0 <= x <= 100000
60
the number of output (or completion) tokens
0 <= x <= 100000000
128
the number of steps to use in the model
1 <= x <= 10000
50
a list of output image sizes
the duration of audio output in seconds
0 <= x <= 100000
60
the number of audio tokens in the output
0 <= x <= 100000000
2300
the number of video frames (frame rate x duration)
0 <= x <= 100000000
60
the resolution of the video in number of lines (for instance, 1080 for 1080p)
1080
Response
0.13
0.81
1.32
0.81
1.32
0.13
0.81
1.32
0.81
1.32
0.13
0.81
1.32
0.81
1.32
0.13
0.81
1.32
0.81
1.32
"gpt-4-turbo"
List of aliases for this model; must be globally-unique with id
["claude-latest", "claude-3-sonnet-current"]
7
ID of the customer who owns this node (visible to admins only)
ID of the user who created the node (admin or owner only)
"GPT-4 Turbo"
"gpt"
"EleutherAI/gpt-neo-2.7B"
"GPTJ-6B"
175
8
1
fp8
, fp8-e4m3
, fp8-e5m2
, fp16
, tf32
, fp32
, fp64
, bfloat8
, bfloat16
, bf16
, int4
, int8
, int16
, int32
, int64
, uint4
, uint8
, uint16
, uint32
, uint64
Common types of AI/ML models and their primary functions:
- Text-based models for natural language processing
- Vision models for image analysis and generation
- Audio models for speech and sound processing
- Multimodal models that combine different types of inputs/outputs
- Specialized models for specific use cases
text-generation
, chat
, text-embedding
, text-classification
, sentiment-analysis
, named-entity-recognition
, question-answering
, summarization
, translation
, image-classification
, object-detection
, image-segmentation
, image-generation
, image-to-text
, text-to-image
, style-transfer
, face-detection
, facial-recognition
, speech-to-text
, text-to-speech
, speaker-identification
, audio-classification
, music-generation
, multimodal-embedding
, multimodal-generation
, visual-question-answering
, recommendation-system
, reinforcement-learning
, anomaly-detection
, time-series-forecasting
, clustering
1013.1
1013.1
1013.1
11013.1
11013.1
1013.1
1013.1
"llama_31_8b"
Create a new node. Note on permissions:
- cloud_instance_id and managed_service_id can only be set by admins or users who own those resources
- Custom nodes are visible only to their owners
- Global nodes are visible to all users
- Admins can see and manage all nodes
3 - 64
"my-custom-node-1"
"a100_40gb"
0 <= x <= 10000
8
1 <= x <= 10000
2
Cloud ID as defined by the Scope3 API
1 - 64
"aws"
"a2-highgpu-1g"
Managed Service Provider ID
3 - 64
"aws-bedrock"
0 <= x <= 10000
100
0 <= x <= 1
0.8
0 <= x <= 100000
2500
0 <= x <= 100000
2500
1 <= x <= 30
5
ID of the customer who owns this node (visible to admins only)
ID of the user who created the node (admin or owner only)
Two-letter country code as defined by ISO 3166-1 alpha-2
2
"US"
0 <= x <= 2000
475
Two-letter region code as defined by ISO 3166-1 alpha-2
2
"NY"
false
0.13
0.81
1.32
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,
"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
}