Hi, I’m working on a .NET application that calls several OpenAI compliant API’s. I’m using the official .NET library for the OpenAI API. This is working with OpenAI and several other platforms that are OpenAI compatible. However, the SambaNova chat completions API is causing an error because the created
value in the response is a floating point number. The OpenAI specification indicates that this should be a unix timestamp value in seconds. This results in a 64-bit integer, and not a float.
https://platform.openai.com/docs/api-reference/chat/object
Here is the code from the official OpenAI .NET SDK that expects the created
value to be Int64
. Again, this works with OpenAI itself and many other providers. The only provider currently causing errors is SambaNova.
if (prop.NameEquals("created"u8))
{
createdAt = DateTimeOffset.FromUnixTimeSeconds(prop.Value.GetInt64());
continue;
}
Here is an example value that I get from the SambaNova API:
“created”: 1756229265.7718627,