Skip to main content

讯飞

modelprice
认知大模型 V1.50.18/10k tokens
认知大模型 V2.00.36/10k tokens
  • QPS=2
  • 1token=1.5中文、0.8英文单词

星火认知大模型

authorization

hmac, APISecret, base64

host: spark-api.xf-yun.com
date: Fri, 05 May 2023 10:43:39 GMT
GET /v1.1/chat HTTP/1.1
const {
createHmac,
} = await import('node:crypto');

const apiSecret = 'MjlmNzkzNmZkMDQ2OTc0ZDdmNGE2ZTZi'
const date = new Date('Fri, 05 May 2023 10:43:39 GMT')
const hmac = createHmac('sha256', apiSecret);
hmac.update(`
host: spark-api.xf-yun.com
date: ${date.toUTCString()}
GET /v1.1/chat HTTP/1.1
`.trim());
console.log(hmac.digest('base64'));