This repository serves as a central registry for Bittensor subnet API definitions used by the BitMind Intelligence Oracle.
NOTE: Subnets must have a public API endpoint that can be accessed by the BitMind Intelligence Oracle.
To add a new subnet to the registry:
-
Create a new directory under
subnets/
with your subnet UID as the namemkdir -p subnets/<subnet-id>/examples
-
Create an
api.yml
file in your subnet directory using this format:baseUrl: "https://your-api-endpoint.com" endpoints: - path: /endpoint-path # Used as the path for the BitMind Intelligence Oracle API endpoint externalPath: /external-path # Must match the public API endpoint method: POST # HTTP method (GET, POST, PUT, DELETE) summary: "Summary of the endpoint" description: "Description of the endpoint" auth: type: header key: "Authorization" value: "{{api-key}}" headers: Content-Type: application/json requestSchema: type: object properties: param1: type: string description: "Description of parameter" # Add other parameters required: [param1] # Optional response schema responseSchema: type: object properties: result: type: string description: "Description of result"
-
Add example request/response pairs in the
examples/
directory for each endpoint:subnets/<subnet-id>/examples/<endpoint_path>/request.json subnets/<subnet-id>/examples/<endpoint_path>/response.json
-
Create and push a feature branch for your changes
-
Test your changes locally before submitting a PR
-
Validate your OpenAPI specification using the ReadMe.io validator (see docs/README.md for detailed instructions)
-
Submit a pull request to the
staging
branch with your changes
To remove a subnet from the registry:
-
Delete the subnet directory:
rm -rf subnets/<subnet-id>
-
Create a feature branch for the removal
-
Submit a pull request to the
staging
branch with the removal
To update subnet API definitions:
- If replacing an existing subnet entirely, simply replace the contents of the existing directory
- If making updates, edit the
api.yml
file in your subnet directory - Update any examples as needed
- Create a feature branch for your changes
- Submit a pull request to the
staging
branch with your changes
The api.yml
files follow a standard format that includes:
baseUrl
: The base URL for all endpointsendpoints
: An array of endpoint definitions including:path
: The path for the BitMind Intelligence Oracle API endpointexternalPath
: The path for the public API endpointmethod
: HTTP methodsummary
: Summary of the endpointdescription
: Description of the endpointauth
: Authentication requirementsheaders
: Required headersrequestSchema
: JSON Schema for the request payloadresponseSchema
: JSON Schema for the response (optional)