Download OpenAPI specification:Download
List of endpoints and interfaces available to Codex API users
[- {
- "id": "268a781e0db3f7cf36b18e5f4fdb7f586ec9edd08e5500b17c0e518a769f114a",
- "request": {
- "id": "string",
- "client": "string",
- "ask": {
- "slots": 0,
- "slotSize": "string",
- "duration": "string",
- "proofProbability": "string",
- "reward": "string",
- "maxSlotLoss": 0
}, - "content": {
- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
}, - "expiry": "10 minutes",
- "nonce": "string"
}, - "slotIndex": "string"
}
]
slotId required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N File to be downloaded. |
{- "id": "268a781e0db3f7cf36b18e5f4fdb7f586ec9edd08e5500b17c0e518a769f114a",
- "slotIndex": "string",
- "requestId": "0x...",
- "request": {
- "id": "string",
- "client": "string",
- "ask": {
- "slots": 0,
- "slotSize": "string",
- "duration": "string",
- "proofProbability": "string",
- "reward": "string",
- "maxSlotLoss": 0
}, - "content": {
- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
}, - "expiry": "10 minutes",
- "nonce": "string"
}, - "reservation": {
- "id": "0x...",
- "availabilityId": "0x...",
- "size": "string",
- "requestId": "0x...",
- "slotIndex": "string"
}, - "state": "SaleCancelled"
}
id | string (Id) = 66 characters 32bits identifier encoded in hex-decimal string. |
totalSize required | string Total size of availability's storage in bytes as decimal string |
duration required | string (Duration) The duration of the request in seconds as decimal string |
minPrice required | string Minimal price paid (in amount of tokens) for the whole hosted request's slot for the request's duration as decimal string |
maxCollateral required | string Maximum collateral user is willing to pay per filled Slot (in amount of tokens) as decimal string |
{- "id": "0x...",
- "totalSize": "string",
- "duration": "string",
- "minPrice": "string",
- "maxCollateral": "string"
}
{- "id": "0x...",
- "totalSize": "string",
- "duration": "string",
- "minPrice": "string",
- "maxCollateral": "string",
- "freeSize": "string"
}
The new parameters will be only considered for new requests. Existing Requests linked to this Availability will continue as is.
id required | string ID of Availability |
id | string (Id) = 66 characters 32bits identifier encoded in hex-decimal string. |
totalSize | string Total size of availability's storage in bytes as decimal string |
duration | string (Duration) The duration of the request in seconds as decimal string |
minPrice | string Minimal price paid (in amount of tokens) for the whole hosted request's slot for the request's duration as decimal string |
maxCollateral | string Maximum collateral user is willing to pay per filled Slot (in amount of tokens) as decimal string |
{- "id": "0x...",
- "totalSize": "string",
- "duration": "string",
- "minPrice": "string",
- "maxCollateral": "string"
}
Return's list of Reservations for ongoing Storage Requests that the node hosts.
id required | string ID of Availability |
[- {
- "id": "0x...",
- "availabilityId": "0x...",
- "size": "string",
- "requestId": "0x...",
- "slotIndex": "string"
}
]
cid required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N CID of the uploaded data that should be stored |
duration required | string (Duration) The duration of the request in seconds as decimal string |
reward required | string (Reward) The maximum amount of tokens paid per second per slot to hosts the client is willing to pay |
proofProbability required | string (ProofProbability) How often storage proofs are required as decimal string |
nodes | integer Default: 1 Minimal number of nodes the content should be stored on |
tolerance | integer Default: 0 Additional number of nodes on top of the |
collateral required | string Number as decimal string that represents how much collateral is asked from hosts that wants to fill a slots |
expiry required | string Number as decimal string that represents expiry threshold in seconds from when the Request is submitted. When the threshold is reached and the Request does not find requested amount of nodes to host the data, the Request is voided. The number of seconds can not be higher then the Request's duration itself. |
{- "duration": "string",
- "reward": "string",
- "proofProbability": "string",
- "nodes": 1,
- "tolerance": 0,
- "collateral": "string",
- "expiry": "string"
}
id required | string Hexadecimal ID of a Purchase |
{- "state": "cancelled",
- "error": "string",
- "request": {
- "id": "string",
- "client": "string",
- "ask": {
- "slots": 0,
- "slotSize": "string",
- "duration": "string",
- "proofProbability": "string",
- "reward": "string",
- "maxSlotLoss": 0
}, - "content": {
- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
}, - "expiry": "10 minutes",
- "nonce": "string"
}
}
{- "content": [
- {
- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "manifest": {
- "treeCid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "datasetSize": 0,
- "blockSize": 0,
- "protected": true,
- "filename": "codex.png",
- "mimetype": "image/png",
- "uploadedAt": 1729244192
}
}
]
}
content-type | string Example: image/png The content type of the file. Must be valid. |
content-disposition | string Example: attachment; filename="codex.png" The content disposition used to send the filename. |
cid required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N File to be downloaded. |
{- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "manifest": {
- "treeCid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "datasetSize": 0,
- "blockSize": 0,
- "protected": true,
- "filename": "codex.png",
- "mimetype": "image/png",
- "uploadedAt": 1729244192
}
}
cid required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N File to be downloaded. |
cid required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N File for which the manifest is to be downloaded. |
{- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "manifest": {
- "treeCid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "datasetSize": 0,
- "blockSize": 0,
- "protected": true,
- "filename": "codex.png",
- "mimetype": "image/png",
- "uploadedAt": 1729244192
}
}
If addrs
param is supplied, it will be used to dial the peer, otherwise the peerId
is used
to invoke peer discovery, if it succeeds the returned addresses will be used to dial.
peerId required | string (PeerId) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N Peer that should be dialed. |
addrs | Array of strings or null (MultiAddress) Example: addrs=/ip4/127.0.0.1/tcp/8080 If supplied, it will be used to dial the peer.
The address has to target the listening address of the peer,
which is specified with the |
{- "id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "addrs": [
- "/ip4/127.0.0.1/tcp/8080"
], - "repo": "string",
- "spr": "string",
- "table": {
- "localNode": {
- "nodeId": "string",
- "peerId": "string",
- "record": "string",
- "address": "string",
- "seen": true
}, - "nodes": [
- {
- "nodeId": "string",
- "peerId": "string",
- "record": "string",
- "address": "string",
- "seen": true
}
]
}, - "codex": {
- "version": "v0.1.7",
- "revision": "0c647d8"
}
}