Quick Start
An API inference is characterized by a set of input parameters sent to a base model, possibly fine-tuned, running on cloud or proprietary hardware, powered by energy from a grid region, at a particular time, and generating outputs like text, images, audio, and video. The Scope3 AI API uses this information to model the energy use, CO2, and water impact of an inference.
Simple Example
Here’s a simple example of a text generation inference. To try this, POST it to the API endpoint https://aiapi.scope3.com/impact
or use our live API reference. You can also use the Google Sheets Integration to play with the API.
Model Parameters
Models may not accept all of these inputs, but the API is aware of:
- Prompt Tokens: Text input length measured in tokens
- Images: Dimensions in pixels (e.g., 1024x1024), number of diffusion steps
- Audio: Duration and sample rate
Example for image generation:
Example for audio processing:
Base Model
A base model can be specified in four ways. To see the list of models, you can query the List Model API.
1. By Model Family and Name
2. By Model ID
3. By Hugging Face Path
Fine-tuning
Not supported yet
Hardware
1. Managed Service Provider
2. Cloud Instance
3. Dedicated Hardware Node
Task Types
Language Models
- Text generation
- Chat
- Embeddings
- Classification
- Summarization
- Translation
Example of a chat completion:
Computer Vision
- Image classification
- Object detection
- Image generation
- Style transfer
- Upscaling
Example of text-to-image generation:
Audio/Speech
- Speech-to-text
- Text-to-speech
- Audio classification
Example of speech-to-text:
Video Processing and Generation
- Text-to-video generation
- Video-to-video transformation
- Video upscaling
- Frame interpolation
- Video editing
Example of text-to-video generation:
API Response
The API returns impact metrics for each inference:
Complete Example
Here’s a complete example showing multiple inferences:
Error Handling
TODO: Add error handling
Common error codes:
401
: Unauthorized - Invalid or missing API key403
: Forbidden - API key doesn’t have access to requested resource406
: Not acceptable - Invalid request format415
: Unsupported media type429
: Too many requests - Rate limit exceeded