Developer Portal: https://rms.ora.io/
ORA API is an integral part of ORA's Resilient Model Services (RMS). See supported models and pricing of ORA API.
The ORA API serves as the gateway for developers to interact with RMS, providing a decentralized, verifiable, and resilient platform for AI computations.
Advantages of ORA API are the best support for the most AI models in crypto; competitive pricing and predictable onchain cost; verifiable AI inference service; OpenAI compatibility...
Before using the ORA API, developers need to:
Obtain API Key: Register for an ORA API key through developer portal for authenticating requests.
Set Up Environment: Ensure you have Python installed if you're using the SDK, or a tool like cURL for direct API calls.
Smart Contract Management
All API keys are managed directly on the smart contract. This includes both the generation and deletion processes of API keys.
API Key Structure
We do not store your API keys. Instead, the API key is generated through signing a message from the smart contract. The API key has the following structure, which enables you to recover it within your local environment:
{blockchain identifier}:{base58encoding(message:signature(message, privateKey))}
Here, the message is a bytes32
data type within the smart contract.
Key Generation and Deletion Mechanisms
Generating a new API key is analogous to creating a new address from a wallet mnemonic. By monotonically increasing the value of the message, you can obtain a new API key. As for API key deletion, it is achieved by disabling the key within the smart contract.
POST
https://api.ora.io/v1/chat/completions
Generate text responses from ORA API AI models.
Headers
Content-Type
application/json
Authorization
Bearer <ORA_API_KEY>
Body
model
string
Name of AI model
messages
array
Content for AI model to process
POST
https://api.ora.io/v1/images/generations
Generate images based on text prompts.
Headers
Content-Type
application/json
Authorization
Bearer <ORA_API_KEY>
Body
model
string
Name of AI model
prompt
string
Prompt for AI model to process
steps
integer
Number of diffusion steps AI model will take during generation
n
integer
number of images to generate based on prompt
The generated images are stored on IPFS.
ORA API is designed to be compatible with the OpenAI SDK, facilitating a smooth transition for developers already familiar with it:
ORA API supports a variety of open-source models, all verifiable through opML.
Price are measured in unit of $ORA.
Error Handling: Always implement error handling to manage API response errors or timeouts.
Rate Limiting: Be aware of and respect rate limits to avoid service disruptions.
Security: Never expose your API key in client-side code. Use server-side calls or secure environment variables.