Markets API
The Markets API provides information about GPU markets available on the Nosana Network. Markets represent pools of GPU resources where jobs and deployments are scheduled.
Overview
GPU Markets are collections of GPU hosts that offer compute resources. Each market has:
- Specific GPU types (e.g., NVIDIA RTX 3090, RTX 4090)
- Pricing information
- Resource requirements
- Availability status
Use the Markets API to:
- Discover available GPU markets
- Get market details and pricing
- Check required resources for a market
- Select the appropriate market for your workload
List Markets
Get a list of all available markets:
ts
import { createNosanaClient } from '@nosana/kit';
const client = createNosanaClient({
api: {
apiKey: process.env.NOSANA_API_KEY,
},
});
// List all markets
const markets = await client.api.markets.list();
markets.forEach(market => {
console.log(`Market: ${market.name}`);
console.log(`Address: ${market.address}`);
console.log(`Type: ${market.type}`);
});Get Market Details
Get detailed information about a specific market:
ts
// Get market by address
const market = await client.api.markets.get('CA5pMpqkYFKtme7K31pNB1s62X2SdhEv1nN9RdxKCpuQ');
console.log('Market Name:', market.name);
console.log('GPU Type:', market.gpu);
console.log('VRAM:', market.vram);
console.log('Price per Hour:', market.price_per_hour_usd);Get Required Resources
Check the resource requirements for a specific market:
ts
// Get required resources for a market
const resources = await client.api.markets.getRequiredResources(
'CA5pMpqkYFKtme7K31pNB1s62X2SdhEv1nN9RdxKCpuQ'
);
console.log('Required VRAM:', resources.required_vram);
console.log('Required CPU:', resources.required_cpu);
console.log('Required Memory:', resources.required_memory);Market Types
Markets can be categorized into different types:
- PREMIUM: Validated, high-performance GPU markets
- COMMUNITY: New or unvalidated GPU markets
Selecting a Market
When creating a deployment, you need to specify a market. Consider:
- GPU Requirements: Match your workload's GPU needs (VRAM, compute capability)
- Pricing: Compare prices across markets
- Availability: Check market availability and queue lengths
- Resource Requirements: Ensure your job definition matches the market's required resources
Example: Finding the Right Market
ts
// List all markets
const markets = await client.api.markets.list();
// Filter for markets with sufficient VRAM
const suitableMarkets = markets.filter(market =>
market.vram >= 24 // Need at least 24GB VRAM
);
// Get detailed requirements for each
for (const market of suitableMarkets) {
const resources = await client.api.markets.getRequiredResources(market.address);
console.log(`${market.name}: ${resources.required_vram}GB VRAM required`);
}
// Select the most cost-effective option
const selectedMarket = suitableMarkets.sort(
(a, b) => a.price_per_hour_usd - b.price_per_hour_usd
)[0];