Dart and Flutter from NordRouter
Example with package http:
dart
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.post(
Uri.parse('https://nordrouter.com/v1/chat/completions'),
headers: {
'Authorization': 'Bearer $apiKey',
'Content-Type': 'application/json',
},
body: jsonEncode({
'model': 'anthropic/claude-sonnet-4.6',
'messages': [{'role': 'user', 'content': 'Привет!'}],
}),
);
if (response.statusCode != 200) throw Exception(response.body);
print(jsonDecode(response.body)['choices'][0]['message']['content']);In a public Flutter app, do not embed a shared API key. Either the user enters his own key, or the request goes through your server.