SDKs overview
CheetahO offers a REST API for image optimization, designed to reduce image file sizes without compromising visual quality, thereby improving website load times and overall performance. The API supports various image formats and provides options for compression levels and resizing. While CheetahO's primary integration method is direct API interaction, developers can utilize official plugins for popular CMS platforms and community-developed libraries to streamline the integration process of the CheetahO image optimization API.
Integrating with CheetahO's API typically involves sending image data to an endpoint and receiving an optimized image in response. This process can be automated within development workflows using standard HTTP client libraries available in most programming languages. The API reference documentation provides details on authentication, available endpoints, and request/response formats. For specific content management systems, CheetahO provides pre-built extensions that abstract the API calls, allowing for direct integration within the CMS environment, such as the CheetahO WordPress plugin.
Developers who prefer a more direct approach can implement custom API clients using generic HTTP client libraries. This offers flexibility in how image optimization is integrated into existing codebases or custom applications. The API follows common web service patterns, making it accessible for developers familiar with HTTP-based interactions.
Official SDKs by language
CheetahO's official support for integration primarily focuses on direct API access and CMS plugins. As of 2026, CheetahO does not explicitly list traditional, language-specific SDKs (Software Development Kits) on its documentation portal that encapsulate all API functionalities into a client library for various programming languages. Instead, it emphasizes direct integration through its RESTful API and provides extensions for widely used content management systems.
The core product, the CheetahO image optimization API, is designed for direct consumption by any HTTP client. This approach allows developers to use their preferred programming language and HTTP client library to interact with the service.
While dedicated SDKs are not publicly listed, the following table outlines common methods developers use to integrate with CheetahO programmatically, leveraging standard package managers and HTTP clients.
| Language | Common Package/Method | Install Command/Dependency | Maturity |
|---|---|---|---|
| Python | requests library (HTTP client) |
pip install requests |
Stable (for HTTP interaction) |
| JavaScript (Node.js) | axios or node-fetch (HTTP client) |
npm install axios or npm install node-fetch |
Stable (for HTTP interaction) |
| PHP | Guzzle HTTP client |
composer require guzzlehttp/guzzle |
Stable (for HTTP interaction) |
| Ruby | faraday or net/http |
gem install faraday |
Stable (for HTTP interaction) |
| Java | OkHttp or Apache HttpClient |
Maven/Gradle dependency for OkHttp or Apache HttpClient | Stable (for HTTP interaction) |
Installation
For direct API interaction with CheetahO, installation typically involves adding an HTTP client library to your project. The exact steps depend on your chosen programming language and package manager. Below are examples for popular environments:
Python
To use the requests library for making HTTP requests to the CheetahO API:
pip install requests
This command installs the requests library, which simplifies HTTP request handling in Python applications. For detailed usage, refer to the Requests library documentation.
JavaScript (Node.js)
For Node.js projects, axios or node-fetch are common choices for HTTP requests:
npm install axios
# or
npm install node-fetch
These commands add the respective HTTP client library to your Node.js project. axios is a promise-based HTTP client for the browser and node.js, while node-fetch brings the browser's fetch API to Node.js environments. More information is available in the Axios npm package documentation.
PHP
In PHP projects, the Guzzle HTTP client is a standard for making web requests:
composer require guzzlehttp/guzzle
This Composer command installs Guzzle, a PHP HTTP client that can send synchronous and asynchronous requests. Its documentation provides examples for various request types and configurations for Guzzle HTTP client usage.
Ruby
For Ruby applications, faraday is a flexible HTTP client:
gem install faraday
This command installs the Faraday gem, which provides a clean API over various HTTP adapters. Developers can choose the underlying HTTP client library that Faraday uses. The Faraday GitHub repository contains further installation and usage instructions.
Java
For Java projects, OkHttp or Apache HttpClient are popular choices for HTTP communication. Using Maven, you would add a dependency to your pom.xml:
<!-- For OkHttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
</dependency>
<!-- For Apache HttpClient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
Replace versions with the latest stable releases. These dependencies enable your Java application to make HTTP requests to the CheetahO API. Comprehensive guides are available on the OkHttp website and Apache HttpClient documentation.
Quickstart example
This quickstart example demonstrates how to perform a basic image optimization using the CheetahO API with Python's requests library. This code sends an image file to the CheetahO optimization endpoint and saves the optimized image locally. Before running, ensure you have an active CheetahO API key and replace placeholder values.
Python Quickstart
import requests
def optimize_image(api_key, image_path, output_path):
url = "https://api.cheetaho.com/v1/optimize"
headers = {
"Authorization": f"Bearer {api_key}"
}
files = {
"image": (image_path, open(image_path, 'rb'), 'image/jpeg') # Adjust content type if needed
}
params = {
"quality": 85, # Example: 85% quality
"width": 1200 # Example: resize to max width of 1200px
}
try:
response = requests.post(url, headers=headers, files=files, params=params, stream=True)
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
if response.headers.get('Content-Type') == 'application/json':
# API might return JSON error on failure
print("API Error:", response.json())
return False
with open(output_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
print(f"Optimized image saved to {output_path}")
return True
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
return False
# --- Usage Example ---
# Replace with your actual API key and image paths
CHEETAHO_API_KEY = "YOUR_CHEETAHO_API_KEY"
INPUT_IMAGE = "path/to/your/input.jpg"
OUTPUT_IMAGE = "path/to/your/output_optimized.jpg"
if __name__ == "__main__":
if optimize_image(CHEETAHO_API_KEY, INPUT_IMAGE, OUTPUT_IMAGE):
print("Image optimization successful.")
else:
print("Image optimization failed.")
This Python script provides a functional example for interacting with the CheetahO API. It demonstrates how to authenticate a request using an API key, attach an image file, specify optimization parameters like quality and width, and handle the response to save the optimized image. Developers should consult the CheetahO API documentation for the most up-to-date endpoints, parameters, and error handling specifics.
Community libraries
While CheetahO focuses on direct API integration and CMS plugins, the open-source community often develops wrappers or utility libraries to simplify interactions with popular APIs. As of 2026, there are no prominently documented or officially endorsed community-contributed SDKs specifically for CheetahO that abstract the entire API into a language-specific client library model, similar to those found for larger platforms like Stripe's various SDKs or AWS SDKs.
However, developers frequently create their own simple integration scripts or helper functions to manage API calls, authentication, and error handling when working with RESTful services like CheetahO. These might be shared on platforms like GitHub or package managers, but their maintenance and support are typically community-driven and not guaranteed by CheetahO.
Developers seeking to integrate CheetahO into niche environments or highly customized workflows may find existing generic HTTP client libraries (as listed under Official SDKs by Language) to be sufficient for building their own lightweight wrappers. For example, a developer might create a Python class that encapsulates the API key and provides methods like optimize_jpeg() or optimize_png(), making the interaction with the CheetahO API more object-oriented within their specific project.
Before using any third-party community library, it is advisable to review its source code for security, maintainability, and compatibility with the latest CheetahO API specifications. Relying on well-established and maintained HTTP client libraries, as demonstrated in the installation and quickstart sections, generally offers a more robust and supported path for integration when an official, full-featured SDK is not available.