bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 31쪽 중 29쪽
y hosted images)
2. **Sending a Base64 Encoded Image** (for local images)
<CodeGroup>
```python Passing a URL theme={null}
import requests
url = "https://api.intelligence.io.solutions/api/v1/chat/completions"
headers = {
"Authorization": "Bearer \$IOINTELLIGENCE_API_KEY",
"Content-Type": "application/json"
}
data = {
"model": "meta-llama/Llama-3.2-90B-Vision-Instruct",
"messages": [
{"role": "system", "content": "You are an AI assistant."},
{"role": "user", "content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": "https://your-image-url.com/image.jpg"}}
]}
]
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
```
```python Passing a Base64 encoded image theme={null}
import requests
import base64
url = "https://api.intelligence.io.solutions/api/v1/chat/completions"
headers = {
"Authorization": "Bearer \$IOINTELLIGENCE_API_KEY",
"Content-Type": "application/json"
}
image_url = "path_to_your_image.jpg"
image_response = requests.get(image_url)
if image_response.status_code == 200:
image_data = image_response.content # Get raw image bytes
else:
print("Error: Unable to download image")
exit()
base64_image = base64.b64encode(image_data).decode("utf-8")
data = {
"model": "meta-llama/Llama-3.2-90B-Vision-Instruct",
"messages": [
{"role": "system", "content": "You are an AI assistant."},
{"role": "user", "content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image", "image": base64_image}
]}
]
}
response = requests.post(url, json=data, headers=headers)
try:
print(response.json()) # Parse JSON response
except requests.exceptions.JSONDecodeError:
print("Error: Unable to parse response. Raw response:", response.text)
```
</CodeGroup>
<Info>
The image URL must be publicly accessible. Private or authentication-required URLs will not work.
</Info>
### Image Input Requirements
To ensure successful processing, images must meet the following requirements:
| Requirement | Details |
| - | - |
| *Format* | JPEG, PNG, WEBP, or GIF (static) |
| *Max File Size* | 20MB |
| *Resolution* | At least 512x512 pixels (recommended) |
| *Max Dimensions* | 4096×4096 pixels |
| *Accessibility* | If using a URL, ensure it is publicly accessible |
| *Multi-Image Support* | Up to 10 images per request |
**Best Practices for Image Uploads**
* **Optimize File Size**: While the maximum limit is 20MB, smaller files (1-5MB) ensure faster processing.
* **Use Clear Images**: Avoid blurry or low-resolution images for better AI analysis.
* **Ensure Public URLs**: If passing a URL, test it in a browser to confirm that it is accessible.
### Expected API Response
Upon successful submission, the API will return a structured response with AI-generated insights based on the image.
**Example Response:**
<CodeGroup>
```json json theme={null}
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1710456789,
"model": "meta-llama/Llama-3.2-90B-Vision-Instruct",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is an image of a cat sitting on a table."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 120,
"completion_tokens": 20,
"total_tokens": 140
}
}
```
</CodeGroup>
### Common Issues & Troubleshooting
| Issue | Possible Cause | Solution |
| - | - | - |
| *"An image? I'm in text format, so I can't see it..."* | Model does not support image input. | Ensure you are using one of the supported vision models. |
| *"Invalid image format"* | Image not encoded properly. | Convert image to base64 before sending. |
| *"Unauthorized"* | API key is missing or incorrect. | Check that your API key is valid and correctly formatted. |
# Check available replicas per location
Source: https://io.net/docs/reference/caas/available-replicas
openapi/caas/available-replicas.json GET /enterprise/v1/io-cloud/caas/available-replicas
Returns the number of deployable replicas in each location based on selected hardware type and GPU count per container, useful for matching supply to workload needs.
By leveraging this endpoint, it's possible to discover the current supply on the platform that fits workload requirements and use this data during the deployment process.
# Check maximum GPUs per container
Source: https://io.net/docs/reference/caas/check-maximum-gpus-per-container
openapi/caas/check-maximum-gpus-per-container.json GET /enterprise/v1/io-cloud/caas/hardware/max-gpus-per-container
Returns the maximum number of GPUs available per hardware type across all locations, helping to determine deployment limits by hardware.
By leveraging this endpoint, it's possible to discover the current supply on the platform that fits workload requirements and use this data during the deployment process.
# Container Job Details
Source: https://io.net/docs/reference/caas/container-job-details
openapi/caas/container-job-details.json GET /enterprise/v1/io-cloud/caas/deployment/{deployment_id}/containers-jobs/{container_id}
Inspect job-level details of a specific container within a deployment.
# Container Logs
Source: https://io.net/docs/reference/caas/container-logs
openapi/caas/container-logs.json GET /enterprise/v1/io-cloud/caas/deployment/{deployment_id}/log/{container_id}
Access real-time or historical logs for a specific container in a deployment.
## Fetching Container Logs via API
* The logs endpoint always **produces a chunked response** - it’s a **stream**.
* Specifically, it uses **Server-Sent Events (SSE)** for streaming logs.
* **Do not** use r`esponse.json();` consume the logs line-by-line.
* Currently, the **API spec is incomplete**:
* `offset` and `stream type` query parameters are missing.
* Public API specs need a full review to match Swagger; other fields may be missing.
### Python Example
```python theme={null}
import requests
# Replace with your Deployment and Log IDs
deployment_id = "Deployment ID"
log_id = "Log ID"
url = "https://api.io.solutions/enterprise/v1/io-cloud/caas/deployment/{deployment_id}/log/{log_id}"
headers = {
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
# Use stream=True to handle the response incrementally
with requests.get(url, headers=headers, stream=True) as r:
r.raise_for_status()
for line in r.iter_lines():
if line:
print(line.decode("utf-8"))
```
### Notes
* Treat all responses as **streams**, not JSON.
* Each line corresponds to a log entry (stdout/stderr), as seen in the UI.
* SSE allows for real-time log consumption for monitoring/debugging.
# Deploy a Container
Source: https://io.net/docs/reference/caas/deploy-a-container
openapi/caas/deploy-a-container.json POST /enterprise/v1/io-cloud/caas/deploy
This endpoint is used to deploy a CaaS cluster on IO.NET infrastructure. The container must expose an HTTP server on a single port, and it must run within a single node.
## **Important Constraints:**
* **Only HTTP server containers are supported.**
* **Only a single traffic port is allowed.**
* **Each container must use a minimum of 1 GPU, with no maximum GPU limit.**
* Multi-node GPU configurations are not supported at this time.
# Destroy Container
Source: https://io.net/docs/reference/caas/destroy-container
openapi/caas/destroy-container.json DELETE /enterprise/v1/io-cloud/caas/deployment/{deployment_id}
Shut down a deployment and release associated resources.
# Extend Deployment Duration
Source: https://io.net/docs/reference/caas/extend-deployment-duration
openapi/caas/extend-deployment-duration.json POST /enterprise/v1/io-cloud/caas/deployment/{deployment_id}/extend
Increase the runtime of an existing deployment without redeploying.
# Get All Deployments
Source: https://io.net/docs/reference/caas/get-all-deployments
openapi/caas/get-all-deployments.json GET /enterprise/v1/io-cloud/caas/deployments
View a list of all your active and past deployments.
# Get Deployment Details
Source: https://io.net/docs/reference/caas/get-deployment-details
openapi/caas/get-deployment-details.json GET /enterprise/v1/io-cloud/caas/deployment/{deployment_id}
Retrieve detailed information about a specific deployment.
# Getting Started with CaaS API
Source: https://io.net/docs/reference/caas/get-started-with-caas-api
The CaaS API lets you programmatically deploy and manage high-performance containerized workloads on io.net’s decentralized GPU network.
<iframe title="Get Started with CaaS API" />
## Generate an API key
You can obtain an API key for IO Cloud in two ways:
1. Via the web interface
2. By using a two-step process (first generate a JWT token, then request the API key using cURL).
### Option 1: Generate an API Key via Web Interface
IO Clouds APIs authenticate requests using API keys. You can [generate API keys from your user](https://ai.io.net/ai/api-keys) account. **Note: When generating an API key, make sure to specify the associated IO Cloud project.**
<Warning>
Always treat your API key as a secret. Do not share it or expose it in client-side code (e.g., browsers or mobile apps). Instead, store it securely in an environment variable or a key management service on your backend server.
</Warning>
### Option 2: Generate an API Key Using a JWT Token
#### Step 1. Get a JWT Token
IO's API is built around [RESTful](https://en.wikipedia.org/wiki/REST) principles. You can use IO's APIs to gain insights into different elements of our network.
To use IO's APIs, you must supply a JWT token in the header of your request. Follow the instructions below to generate a token:
1. Go to **io.net** > **IO ID** > **io.cloud** tab.
2. In the UI, right-click and select **Inspect**.
3. In the Inspect tool, click **Network**.
4. Refresh the **io.cloud** page.
5. In the list of elements, click **Devices**.
6. Scroll down to the **Request Headers** section.
7. Copy and store the **Token**.
<Info>
This token is valid for 21 days.
</Info>
<Frame>
<img alt="" />
</Frame>
#### Step 2. Generate an API Key via `cURL`
Use the **JWT token** to request your API key:
<CodeGroup>
```curl curl theme={null}
curl -X POST 'https://api.io.solutions/v1/api-keys/' /
-H 'accept: application/json' /
-H 'token: $JWT_TOKEN' /
-H 'Content-Type: application/json' /
-d '{
"description": "API Key Name",
"expires_at": "2025-07-17T19:54:36.418Z",
"project": "io-cloud",
"scopes": ["all"]
}'
```
</CodeGroup>
Use the returned key with the `X-API-KEY` header in your requests.
<Warning>
Always treat your API key as a secret. Do not share it or expose it in client-side code (e.g., browsers or mobile apps). Instead, store it securely in an environment variable or a key management service on your backend server.
</Warning>
<Frame>
<img alt="" />
</Frame>
## Making requests
<Danger>
Accessing APIs requires IO Credits. Please make sure to request IO credits before using any API endpoints. Contact support or visit the [IO Credits](/docs/guides/payment/io-credits) page for more information.
</Danger>
Include the API key in an `Authorization` HTTP header for all API requests:
```
Authorization: X-API-KEY \$IOCLOUD_API_KEY
```
Replace `$IOCLOUD_API_KEY` with your actual **API key.**
### Example: Check Available Replicas per Location
Here is an example `cURL` command to check available replicas per location in IO Cloud:
<CodeGroup>
```curl curl theme={null}
curl https://api.io.solutions/enterprise/v1/io-cloud/caas/available-replicas?hardware_id={hardawer_id}&hardware_qty={hardware_qty} /
-H "X-API-KEY: \$IOCLOUD_API_KEY"
```
</CodeGroup>
<Frame>
<img alt="" />
</Frame>
This request should return a response as follows:
<CodeGroup>
```json json theme={null}
{
"data": [
{
"id": 0,
"iso2": "string",
"name": "string",
"available_replicas": 0
}
]
}
```
</CodeGroup>
# List Deployment Containers
Source: https://io.net/docs/reference/caas/list-deployment-containers
openapi/caas/list-deployment-containers.json GET /enterprise/v1/io-cloud/caas/deployment/{deployment_id}/containers
Get information about all containers running within a specific deployment.
# Deployment Price Check
Source: https://io.net/docs/reference/caas/price-estimation
openapi/caas/price-estimation.json GET /enterprise/v1/io-cloud/caas/price
Calculates the estimated deployment cost based on selected location, hardware, GPU count, duration, and number of replicas. Returns a detailed price breakdown.
**Once** `location_id` **and** `hardware_id`**are known, you can estimate the deployment cost based on the desired configuration.**
As a result, a detailed price breakdown will be returned.\
**This step is optional.**
# Update Deployment Configuration
Source: https://io.net/docs/reference/caas/update-deployment-configuration
openapi/caas/update-deployment-configuration.json PATCH /enterprise/v1/io-cloud/caas/deployment/{deployment_id}
Modify runtime container settings such as environment variables or entrypoints.
<Warning>
Note: Hardware parameters (like hardware\_id, location\_id, and replica\_count) cannot be changed.
</Warning>
<Note>Note: Although earlier examples may use a `container_config` wrapper, the current API expects all configuration fields at the top level of the request body. Including a `container_config` key will result in a "`extra_forbidden`" error.</Note>
# Get Burn Rate
Source: https://io.net/docs/reference/io-cloud/get-burn-rate
openapi/io-cloud/get-burn-rate.json GET /enterprise/v1/io-cloud/users/burn-rate
Hourly cost of your running Pay-As-You-Go bookings and how long your credits will last.
# Device Summary
Source: https://io.net/docs/reference/io-explorer/device-summary
openapi/io-explorer/device-summary.json GET /v1/io-explorer/devices/{device_id}/summary
The Device Summary endpoint provides detailed information on a specific device. This allows you to view the device's status, aspects of connectivity, compute hours served, earnings and more.
# Device Details
Source: https://io.net/docs/reference/io-explorer/get-device-details
openapi/io-explorer/get-device-details.json GET /v1/io-explorer/devices/{device_id}/details
The Device Details endpoint provides comprehensive insights into a specific device, including its status, connectivity, job activity, rewards earned, hire rate, and other key performance metrics.
# Getting Started with IO Explorer API
Source: https://io.net/docs/reference/io-explorer/getting-started-with-your-api
Use IO Explorer APIs to gain insight into the different elements of our network.
<iframe title="Get Started with the IO Explorer API" />
### Authentication
To use io.net APIs, you must supply a *JWT token* in the header of your request.
Follow the instructions below to generate a token:
1. Go to io.net > **Get Started** > **IO Explore** > and the **Workers** tab.
2. In the **UI**, right-click and select **Inspect**.
3. In the **Inspect** tool, click **Network**.
4. Refresh the **Workers** page.
5. In the list of elements, click **Devices**.
6. Scroll down to the **Request Headers** section.
7. Copy and store the token.
<Info>
The token is valid for 21 days.
</Info>
<Frame>
<img alt="" />
</Frame>
### Make an API Call
You can use **cURL** to make API requests. Make sure you replace the following variables:
* `{device_id}`: Your actual **Device ID**, which you can copy from the *Device View* page.
<Frame>
<img alt="" />
</Frame>
* `{your_token}` : The **Token** you previously copied using the **Inspect Tool**.
```bash theme={null}
curl X GET "https://api.io.solutions/v1/io-explorer/devices/{device_id}/details"
-H "Token: {your_token}"
```
### Rate Limits
The base io.net API rate limit is as follows:
* 150 reqs / 10 second (umbrella Rate Limit on IO Explorer)
* **Summary:** 100 / 5 minutes
* **Details:** 100 / 5 minutes
* **Search:** 80 / 1 minute
# Device Object Reference
Source: https://io.net/docs/reference/io-explorer/objects
Defines the structure, attributes, and metrics of a Device within the IO Network. Includes details on hardware specs, network performance, compliance, and job history used for monitoring and rewards calculation.
### Device Object
The **Device Object** represents a compute node within the IO Network, typically a machine or worker running one or more GPUs. It provides the foundational schema for describing devices that contribute compute power to the distributed network.
Each device entry captures details about its hardware, performance metrics, network characteristics, geographic location, and SOC 2 compliance. This object also tracks job-level details such as compute minutes, uptime, and earnings, this allows for transparent performance analytics, availability tracking, and compensation calculation.
***
## Structure Overview
A **Device** includes:
* **Identification** – Unique ID, hardware name, and quantity
* **Performance Metrics** – Uptime, speed, and availability stats
* **Geographic Info** – Location name, ISO code, and country icon
* **Compliance** – SOC 2 certification flag
* **Job History** – Records of compute jobs, earnings, and status
***
## Core Attributes
<ParamField type="string">
The unique identifier for your device.
</ParamField>
<ParamField type="string">
The name of the hardware model used in the device, such as 'RTX A6000'.
</ParamField>
<ParamField type="integer">
The number of hardware components (GPUs) in the device.
</ParamField>
<ParamField type="string">
The performance tier assigned to the device based on its network speed.
</ParamField>
***
## Performance Metrics
<ParamField type="integer">
The percentage of time the device was unavailable.
</ParamField>
<ParamField type="integer">
The average download speed, measured in megabits per second (Mbps).
</ParamField>
<ParamField type="integer">
The average upload speed, measured in megabits per second (Mbps).
</ParamField>
<ParamField type="object">
A breakdown of downtime occurrences by date.
<Expandable title="properties">
<ParamField type="string">
Date of downtime in `YYYY-MM-DD` format.
</ParamField>
<ParamField type="array">
Each entry represents a day's downtime data.
<Expandable title="properties">
<ParamField type="number">
Total downtime duration in seconds.
</ParamField>
<ParamField type="string">
Human-readable note summarizing downtime (e.g., “down for 0 days and 3 hours and 23 minutes”).
</ParamField>
**Example**
```json theme={null}
{
"2023-09-11": {
"downtime": 281.508,
"note": "down for 0 days and 0 hours and 4 minutes"
},
"2023-09-12": {
"downtime": 12193.385,
"note": "down for 0 days and 3 hours and 23 minutes"
}
}
```
</Expandable>
</ParamField>
</Expandable>
</ParamField>
***
## Location & Branding
<ParamField type="string">
The country ISO code (e.g., `CA` for Canada).
</ParamField>
<ParamField type="string">
The name of the country or region where the device is located.
</ParamField>
<ParamField type="string">
The URL of the location icon.
</ParamField>
<ParamField type="string">
The web address of the device’s associated brand icon.
</ParamField>
***
## Compliance & Status
<ParamField type="boolean">
Indicates whether the device meets SOC 2 (System and Organization Controls 2) compliance standards.
</ParamField>
<ParamField type="string">
The current status of the device or job running on it.
</ParamField>
***
## Job History
<ParamField type="array">
An array of job entries representing each compute job executed on this device.
<Expandable title="properties">
<ParamField type="integer">
Total minutes a customer hired the device.
</ParamField>
<ParamField type="integer">
Total minutes the device was active during the job.
</ParamField>
<ParamField type="integer">
Total \$IO earnings for this job.
</ParamField>
<ParamField type="integer">
Earnings deducted (slashed) for downtime or failed performance.
</ParamField>
<ParamField type="integer">
The full payment rate if the device achieved 100% uptime.
</Param프로젝트로 돌아가기